title: Server tag error when passing parameters to javascript from gridview
body: <p>I have a gridview and need to pass two parameters to a javascript function when pressing a button in the gridview.
  The script is the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function AddItem(name,price) {
  
              javascript: simpleCart.add('name=' + name, 'price=' + price, 'quantity=1');
          }    
      &lt;/script&gt;
  </code></pre>
  
  <p>In the gridview I tried passing the parameters like this:</p>
  
  <pre><code>&lt;asp:Button ID="AddCartButton" runat="server" Text="Add To Cart" onClick="AddCartButton_Click" OnClientClick="AddItem('&lt;%# Eval("Name") %&gt;', '&lt;%# Eval("Price") %&gt;')" /&gt;
  </code></pre>
  
  <p>But got a 'Server tag is not well formed error'.</p>
  
  <p>I also tried like this:</p>
  
  <pre><code>&lt;asp:Button ID="AddCartButton" runat="server" Text="Add To Cart" onClick="AddCartButton_Click" OnClientClick='&lt;%# Eval("Name","Price", "return AddItem({0},{1})") %&gt;'  /&gt;
  </code></pre>
  
  <p>But the Eval function only seems to allow the passing of 1 parameter.</p>