I'm getting error on binding a javascript method call using Eval(). Following is the line of code within a repeater control:
<asp:Button ID="View" runat="server" Text="View" CommandName="View" OnClientClick="OpenInNewWindow(<%# Eval("JobID")%>)">
</asp:Button>
I need to get the value jobId for that javascript method. Can anyone help me out?
Try this:
<asp:Button ID="AddCartButton" runat="server" Text="Add To Cart" onClick="AddCartButton_Click"
OnClientClick='<%# Eval("JobID", "OpenInNewWindow(\"{0}\").ToString()") %>'/>
each single quote disorientate markup parser. Except this one, expression evaluated practically the same way as regular C# expression
Corrected the syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With