0
|
I'm trying to add some JQuery to an ASP.Net User Control to check to see if checkboxes have been selected or not. It appears that scripting languages are not supported directly in user controls, but need to be added via the RegisterStartupScript() method. I found a post at this url describing this:http://www.codeproject.com/KB/aspnet/Javascript%5Fin%5FUsercontrol.aspx. The post says that in the code behind file you build up the syntax for the scripting code as a string and then send it as a parameter to RegisterStartupScript() method. I'm having problems getting this to work, and was hoping someone may know of a better way to add script to an ASP.Net User Control.
I've created a simplified sample and here is the markup for my user control:
If I include this script tag in the aspx file containing the user control, nothing happens. If I don't include it, I get a JavaScript error dialog saying there was a runtime error and that an Object was expected.
| ||||||
|
Tuesday, March 19, 2013
JQuery in ASP.Net User Control in C#
http://stackoverflow.com/questions/1433972/jquery-in-asp-net-user-control-in-c-sharp
Subscribe to:
Post Comments (Atom)