title: Passing event args from javascript to code-behind while using ClientScript.GetPostBackEventReference
body: <p>I'm trying to trigger a postback from <em>java-script</em> and also pass event args. I'm able to trigger the postback **but not able to pass event args.</p>
  
  <p>The below function does not work. It does not like the <code>args</code> parameter in <code>ClientScript.GetPostBackEventReference</code>.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  function TriggerServerSideClick(args) {
    //btnDummy is a asp.net server-side button control            
    &lt;%=ClientScript.GetPostBackEventReference(btnDummy, args , true)%&gt;
  
    //tried this -&gt;  &lt;%= 'ClientScript.GetPostBackEventReference
    //      (btnDummy,' + args + ', true)' %&gt; , 
    //      but i guess i am definitely missing something.
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>What am I missing here ? </p>
  
  <p>I know that the following works  </p>
  
  <pre><code> __doPostBack('btnDummy', args); 
  </code></pre>
  
  <p>but want to stay away from <code>__doPostBack</code> as that could change eventually and try the <code>ClientScript.GetPostBackEventReference</code> instead.</p>
  
  <p>Thanks for your time.</p>
  
  <p>@Brian: Thanks a lot for following up. I tried your placeholder approach but I am getting a javascript error. (<strong>Message: Expected ';'</strong>)<br>
  Here is the viewsource snippet:           </p>
  
  <pre><code>var postbackUrl = '__doPostBack('ctl00$MainContent$btnDummy','{0}')';
  
     function TriggerServerSideClick(args) {
  
        var url = String.format(postbackUrl, args);
        eval(url);
     }
  </code></pre>