"Frank Milverckowitz" <fr****************@yahoo.comwrote in message
news:45***********************@roadrunner.com...
I'm using Visual Studio 2005 and notice that the generated pages are of
DTD/Doctype that don't support framesets. To use framesets I will be
changing all pages to HTML 4.0 loose.dtd.
Just change the DOCTYPE to XHTML 1.0 Frameset.
I have a demand from my boss to use framesets to create a "keep-alive"
feature using a parent frame + ajax call on a time interval. (i.e. have
the xml http object call some page on the server just to keep the session
alive).
Firstly, you certainly don't *need* to use frames for this - the whole point
of a MasterPage is that all content pages based on it share not only the
same look and feel but also any functionality contained within the
MasterPage.
In addition, lots of people will tell you frames are "bad" - in fact, I've
contracted at companies where they are expressely forbidden!
Should I be using Masterpages instead? I see that a masterpage "content
area" is mainly a <divand that divs can contain a scrollbar. In addition
to my need for using AJAX from the masterpage, will a masterpage give me
the look and feel that a frameset might?
Yes indeed.
However, one word of caution - one of the most common mistakes people make
when first coming to MasterPages is to assume that they're somehow the
ASP.NET v2 equivalent of framesets - they aren't at all.
With a frameset, typically the header, footer and "menu" frame remain static
while the content is changed. With MasterPages, this is not the case at all.
In fact, once you realise that a MasterPage is actually not a page but a
UserControl, it becomes a lot clearer.
To move from the first content page to the second content page, you simply
redirect to the second content page which ASP.NET will construct by merging
the MasterPage (and any other UserControls) with the content page itself,
render the HTML and then stream it down to the client browser. The whole
page gets rebuilt every time because the MasterPage is just another
UserControl.