Skip to content Skip to sidebar Skip to footer

Jquery Is Not Working In Master Page Using Asp.net C# And Working Fine With Without Using Master Page

This code works fine in .aspx page no issues. but if i use master page then nothing works fine here,i tried placing the JQuery script in Master page, even then nothing is working.

Solution 1:

Try to change your Jquery reference to be like :

<script type="text/javascript" src="<%= Page.ResolveClientUrl("~/scripts/jquery-1.3.2-vsdoc2.js") %>"></script>

Solution 2:

Is the js file being downloaded? Use network under developer tools (F12) too check. Also check in the final page's HTML that the IDs of the controls are really the ones you use in your script.

Solution 3:

I had same problem. When viewing output source code in browser client I noticed that all "ids" were modified with the ContentPlaceHolderID as a prefix before the id itself, so the Id´s jQuery was looking for did not exist anymore.

Solution was to include the parameter ClientIDMode="Static" in the "Content section" of the child page so id objects remain the same on content pages, and jQuery can find it by the original id.

Hope it helps.

Post a Comment for "Jquery Is Not Working In Master Page Using Asp.net C# And Working Fine With Without Using Master Page"