473,651 Members | 2,670 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 8999
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.comw rote 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.comw rote 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
4344
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 normal class? I have no problem to call the masterpage's methods from a contentpage, but what I would like to do is someting like this... public partial class MyMaster : System.Web.UI.MasterPage
9
1879
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 class from a Page that uses the MasterPage. How do I do that? public partial class List : System.Web.UI.MasterPage { protected ArrayList m_SortList;
3
2080
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, for example, that the Page_Load on the specific page executes before the Page_Load of its MasterPage. Is this right? But what I really want to understand is VARIABLE SCOPE, etc. between the two. For example: Is there a way for me to write code...
5
1736
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 between them it don't work, if the default masterpage is "onepanel.master" and try to change it in runtime, ContentPanel2 which is exist in the loaded masterpage throw exception.. the same happen if the default is "twopanel.master" and switch it...
4
1616
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 = new MasterPage(); But there is no way to do something like: MasterPage master = new MasterPage("~/default.master");
2
2528
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 it's intended for)... But now here comes the time where some pages need some processing (like, is the user logged? and those kind of things)... If it was only on 1 or 2 pages, I'd says, i'll put it directly in the code and case closed, but there...
6
6171
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 Creating Control - Content. Content controsl can only be used in a content page." I know that there's an issue w/ nested masters, but I'm only trying to use one. Interestingly, if I run the site, it builds and displays properly despite this error. Any...
7
13030
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 changed from default.aspx to students.aspx. I tried to create a subroutine in MasterPage.master.vb to do it. The code is as following. But, the default.aspx's content is shown in MasterPage even I clicked the student button.
12
5608
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
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.