OnClientClick in girdView ??
-
OnClientClick='<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>' give error how can I write it correctly? aj123
Tkp1452 wrote:
'<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>'
Try like this. I am not sure, whether it works or not. '<%# "window.open('open.aspx?cID="+ Eval("cID")+"')" %>' But I have used like this, (for Anchor tag) href='<%# "ToolDescription.aspx?ToolId=" + Eval("ToolID") %>' Please let me know your feedback
Regards, Jay :)
-
OnClientClick='<%# Eval("cID" , "window.open("open.aspx?cID={0}");" ) %>' give error how can I write it correctly? aj123
I'm pretty sure the error is coming from the <%# %> tags. At the point of OnClientClick, everything is being directly translated into JavaScript, and Javascript does not support those tags. If you need to combine asp.net variables with javascript, I'd recommend using the click attribute, and setting up a server side event handler. Either that, or you could always "cheat" it, by having a hidden data field that you write to via asp.net, and read from via javascript to execute your Eval(). -Roo