views:

100

answers:

3

Does JavaScript create an issue when we implement master pages?

It seems to me that it is quite tough to maintain and implement JavaScript on an application where we have used master pages. Is there any shortcut or the other way round to it?

I referred this link, http://jai-on-asp.blogspot.com/2009/12/master-pages-in-aspnet-35.html, to learn master pages.

+5  A: 

Hai HotTester,

The Major issue would be finding ClientId's of controls used in your application.

Pandiya Chendur
+1  A: 

There are no javascript issues when using master pages in asp.net unless you create some. ;)

While writing javascript you should see the final html generated when the page is processed and work on that html rather than thinking in terms of master page or content pages. You can put your common javascript functions in the master page so that it can be accessed in all the content pages. Also I would recommend putting all your javascript in an external file and including it in the master page. This is a good practice.

If you are facing some issues you can post the specific problem and we can try and solve them.

All the best...

Hemanshu Bhojak
A: 

There is no issue with finding of ClientID's in MasterPages in ASP.Net 3.5... As the content page has its own head tag unlike ASP.Net 2.0

Nav Ali