pass a databinder.eval as parameter for a javascript function...
-
hi all, How can i call a javascript function from onclick event and pass a parameter something like this "<%# DataBinder.Eval (Container.DataItem, "Description") %>" here's my code, i tried it, but there's an error, syntax? OnClick="javascript:EventCall("<%# DataBinder.Eval(Container.DataItem, "Description")%>");" /> i tried googling but still can't find the right one. Thanks a lot! -- Ewin
-
hi all, How can i call a javascript function from onclick event and pass a parameter something like this "<%# DataBinder.Eval (Container.DataItem, "Description") %>" here's my code, i tried it, but there's an error, syntax? OnClick="javascript:EventCall("<%# DataBinder.Eval(Container.DataItem, "Description")%>");" /> i tried googling but still can't find the right one. Thanks a lot! -- Ewin
What is the error I suspect your problem is that your method uses " and so does your onclick, so the compiler gets confused. Use ' inside your javascript code. But, impossible to say when you don't tell us what the problem is.
Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.