Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Master Pages and Overall Site Feel Style ?

Status
Not open for further replies.

rhnewfie

Programmer
Jun 14, 2001
267
CA
Is it proper architecture to use content pages based on your master page for all of your pages? I would think so but thought I would ask. All of my pages have to have the same look (side bars, top menu, site map etc..) Just wanted to field some opinions.

Thanks!
 
Do you have to do that? No. It doesn't make sense to have different looks to pages, except in some instances. In your case the Master Page route seems like just what you want.
 
In my opinion master pages get very messy. I used them for a few small sites and it works fine, however I tried it on a large site and it was just too much of a headache (although I will admit this new site uses a lot of AJAXing ;-) ). Referencing controls via javascript is much more of a pain with master pages. Also the scattering of code is a problem too.

Just somethings to be aware of.
 
Referencing controls via javascript is much more of a pain with master pages.
Why do you find it harder with master pages?

Also the scattering of code is a problem too.
Not sure I follow you here. Can you eleborate?



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Good questions by ca8msm..
Also, we use master pages for our main site here which is large and on our other sites. They have actually made life much easier.
 
I may just be doing it incorrectly, but how do you inject JS into the head of a page?

How do you guys inject JS in the head of the page? I know that I can do a registerstartup script, or page script, but that does not put it in the head tags (I guess you could set the runat attribute in the head tag, but I'm not too sure that would work correctly).

Also, if you write something like

Code:
 //This is the function that will handle the string returned from the server
        function CallBackHandler(result, context)
        {
            if (context.CommandName == "GetDetails") 
            {
            
                //Splitting the string returned by the server (AJAX can only return a string)
                SplitResults = result.split("| |");
                
                 //Checking to see if any errors occured
                if (SplitResults[0] == "Error")
                {   
                    window.location = SplitResults[1];
                }
                else
                {
                {document.getElementById('hypName').innerHTML = SplitResults[0]+ ' ' + SplitResults[3] + 
                    ', ' + SplitResults[1] + ' ' + SplitResults[2];}

ETC...

Don't the objects on your page (i.e. hyperlinks, textboxes, etc) receive different names when using a master page?
 
You should probably start your own thread for better results.
 
Nah, I'm just trying to give a differing opinion on the use of masterpages. I might use them in the future again, but not without some further investigation. My app seems to be a lot faster without the use of them, plus I think JS is harder to read in the code behind page.

Also, if you do use them be sure that the interface is minimal so that you have room to work on your other content pages.
 
You should probably start your own thread for better results.
This is a completely relevant topic as the discussion is about Master Pages and anything that could affect their usage is surely of interest to you since you asked the question?

I may just be doing it incorrectly, but how do you inject JS into the head of a page?
There are many methods, however, I don't see why you think this is a limitation that has arisen due to the use of a Master Page. In the applications you build, how do you insert javascript into the head section of a standard Page? Whichever method you use is still applicable when using Master Pages.

How do you guys inject JS in the head of the page?
Personally, I use a Literal Control.

Also, if you write something like
...
Don't the objects on your page (i.e. hyperlinks, textboxes, etc) receive different names when using a master page?
Yes, they do but this is the same in a standard Page if you have controls within another control (for example, if you have some in a Panel). To get around this, you use the ClientID of the relevant control that you want to access.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top