Send parameters to method from markup to code behind
Posted on 2010-09-23
I have an image button nested inside a datalist control. When user clicks the image button, I want to run a method from my code behind. In my Image Button markup I have this:
OnClick='<%# "ShowDetail(" & Cstr(Eval("ID")) & ")" %>'
This does not work and I am not sure why. This code produces thie error:
Microsoft jscript runtime error: Object Expected
What I do know is that when I call the method without arguments, like this:
I have no problem. But, I need to send the argument.
Any help is greatly appreciated