473,513 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Frameset vs. Masterpage

Hi,

New to .NET... question about Masterpages vs. using Frameset

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.

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).

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?
Thanks for any tips,
frank
Feb 9 '07 #1
2 8988
Hi Frank,

First, there is no reason you can't change the DOCTYPE of the pages that are
auto-generated in Visual Studio to XHTML 1.0 Frameset if you wish. However,
Framesets can be tricky in ASP.Net due to the different ways that browsers
handle Sessions in frames.

In addition, there is no reason that a "parent frame" should be necessary to
use Ajax for a keep-alive. Using MasterPages would certainly simplify the
process of adding your keep-alive Control to every page. In addition, it
allows you to use one or more layout templates that hold the major part of
the common page layout, removing the necessity to re-use common markup and
Controls in many pages, and removing that markup from the pages during the
development process.

So, yes, I would use MasterPages.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.

"Frank Milverckowitz" <fr****************@yahoo.comwrote in message
news:45***********************@roadrunner.com...
Hi,

New to .NET... question about Masterpages vs. using Frameset

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.

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).

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?
Thanks for any tips,
frank

Feb 9 '07 #2
"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.
Feb 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4337
by: Leffe Andersson | last post by:
Hi folks! I have a MasterPage with some public methods, and I would like to call them from a (app_code) class. Is it possible to set a directive or an assembly reference to a MasterPage from a...
9
1874
by: User | last post by:
OK, I asked in a reply, but I've wasted far too long so I'm going to put a new post out there in hopes that it will be more visible. I have a MasterPage. I want to call a method declared in that...
3
2074
by: Alex Maghen | last post by:
Hi. I'm a little confused about the code that resides in the code-behind of a MasterPage and the code that resides in the code-behind of the actual pages that USE that MasterPage. I'm noticing,...
5
1730
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch...
4
1607
by: cevans | last post by:
Is there a way to load a MasterPage programmatically? Not switch a page's masterpage but to create a MasterPage object that holds a given masterpage. So I know I can do: MasterPage master =...
2
2522
by: ThunderMusic | last post by:
Hi, Maybe there is another way of doing this, but here's my problem... I have my web site where I have a master page to have a common layout and a common behavior on all my pages (that's what...
6
6164
by: =?Utf-8?B?QmVuIFIu?= | last post by:
Hi, WHen I specify my master page in the page's @Page directive, no problems. However, when I put it ias an attribute in Web.config's page element, the designer fails. It just says "Error...
7
13022
by: Bon | last post by:
Dear all I create a master page with image buttons on the left-hand side for navigation. When a user clicks the student button, the content (i.e. ContentPlaceholder) in masterpage will be...
12
5581
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.