R
Roger
I've been developing web applications for a while now. But something
recently came up and i'm unable to provide my concience with a proper
answer.
I'm using class ASP.NET .
All my web pages have the same look and feel. And i enable this with two
simple #INCLUDES. (feature of Class ASP).
One just after the <Body> tag and the other just before the </BODY> tag.
This way all i need to do is to alter the contents of the two Includes and
the layout changes are applied all over.
I know this isn't a good/optimal solution. But the server is really beefed
up and server load isn't an issue. Soon I'll be using ASP.NET Templates.
Now, someone asked me why I'm not doing the following :-
- Create two script files
- In the load event of the page, write the contents of into the page at the
client side.
(thus I'll dynamically build the header and footer templates using
Jscript on the client side).
Apparently this is done a lot for many Jscript menus (I've seen plent of
them).
Now, my question is why not apply the same to the webpages.
The Script file is downloaded only once right.
So, let the scrip files have the header and footer templates embedded in
them as raw strings.
This way, when the user navigates to the next page, all that comes is the
content, and the header and footer will be built up on the client side with
the existing script files.
Whats wrong with the above approach?
recently came up and i'm unable to provide my concience with a proper
answer.
I'm using class ASP.NET .
All my web pages have the same look and feel. And i enable this with two
simple #INCLUDES. (feature of Class ASP).
One just after the <Body> tag and the other just before the </BODY> tag.
This way all i need to do is to alter the contents of the two Includes and
the layout changes are applied all over.
I know this isn't a good/optimal solution. But the server is really beefed
up and server load isn't an issue. Soon I'll be using ASP.NET Templates.
Now, someone asked me why I'm not doing the following :-
- Create two script files
- In the load event of the page, write the contents of into the page at the
client side.
(thus I'll dynamically build the header and footer templates using
Jscript on the client side).
Apparently this is done a lot for many Jscript menus (I've seen plent of
them).
Now, my question is why not apply the same to the webpages.
The Script file is downloaded only once right.
So, let the scrip files have the header and footer templates embedded in
them as raw strings.
This way, when the user navigates to the next page, all that comes is the
content, and the header and footer will be built up on the client side with
the existing script files.
Whats wrong with the above approach?