I have a problem with jquery not loaded into an asp user element.
I want to just add a click event when I click on the checkbox.
Here is my javascript file
$(document).ready(function() { var arr = jQuery(":checkbox[id*='drpAccountType']"); for (i = 0; i < arr.length; i += 1) { $("#" + arr[i].id).click(function() { alert(this.id) }); } }); if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
User Management Pre-Rendering Events:
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender ScriptManager.RegisterClientScriptInclude(Me, Me.GetType, "CheckboxdropdownScript", ResolveUrl("~/Scripts/CheckBoxDropDown.js")) End Sub
The script loads fine, but any use of jQuery returns undefined. Then only when loading the page can I release the same code for the command line in firebug. The jquery library is loading on the main page.
Whenever I use jquery in an asp user element, I always find problems, and I always have to crack it to make it work. I am trying to execute all the entries in stackoverflow, but I never found it as a general solution.
Has anyone found a simple solution for using jquery with main pages, user management in asp.net I would appreciate it if someone could share such valuable information.
My manager is going to remove jquery from the application, since we always take a lot of time to find a workaround for it to work with user controls.
Please help, I like jquery and I really want to use it for a client script.
Best wishes