I wrote Javascript (Jquery) script in Mater page for 2 radio buttons in content page mean i have 2 radio buttons , which show or hides div in content page and the script for it is in MASTER PAGE but it isn't working :( but if i copy Script form master to content page,in head content place holder then it works why ?????

Recommended Answers

All 4 Replies

When you view the results with a browser, and right click and select "view source", examine the script in the head section and take a look at the divs in the body. Are the ID or Classes you are referencing in the jQuery code still valid?

i did so , but still it shows no progress.
and is it right that someone told me that Master Pages just maintaing design for your content pages but doesn't execute or provide script to content pages

i did so , but still it shows no progress.

I do not know what you mean. What I was suggesting is to look at the source code in your browser session, to see if the elements have the IDs that you are trying to target in your JavaScript/jQuery reference.

Master Pages just maintaing design for your content pages but doesn't execute or provide script to content pages

Not true. You can add Stylesheets and JavaScript references in the head section of your master page and it will be included in all your pages that you link to the master. You can even have vb/c# code in your code-behind in that masterpage as well.

ok ok...its done , actually i hadn't mentioned src=jquery in script tag.
thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.