title: Passing variables to javascript in onclientclick
body: <p>Okay, i think i've tried 3-4 methods here from stackoverflow, but none seems to work.</p>
  
  <p>I've got:</p>
  
  <pre><code>OnClientClick='&lt;%# Eval("albumName", "doConfirm(\"delete\", \"{0}\");").ToString() %&gt;'
  </code></pre>
  
  <p>but in html it renders as:</p>
  
  <pre><code>onclick="doConfirm(&amp;quot;delete&amp;quot;, &amp;quot;Test&amp;quot;);"
  </code></pre>
  
  <p>Also tried making a method to call:</p>
  
  <pre><code>public string CreateConfirmation(String action, String item) {
      return String.Format(@"return confirm('Sikker på du vil {0}: {1}');", action, item);
  }
  </code></pre>
  
  <p>With this:</p>
  
  <pre><code>OnClientClick='&lt;%# CreateConfirmation("delete", (string)Eval(albumName)) %&gt;'
  </code></pre>
  
  <p>But gives me exact same problem....
  So im pretty lost?</p>