473,503 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master pages and forms

Do you put your form on the master page or in each individual page? I use a
master page for most of my site. Should the form tag be in the master page?
Thanks.
Mar 29 '06 #1
3 2004
Yes, you put the form on the master page:
http://msdn2.microsoft.com/en-us/lib...hh(VS.80).aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"lanem" wrote:
Do you put your form on the master page or in each individual page? I use a
master page for most of my site. Should the form tag be in the master page?
Thanks.

Mar 29 '06 #2
Sometimes I want to do things in the form tag per the specific page though.
Like, I want to set the defaultfocus in the form on the page, but since the
form is in the master page I can't do that. Each page has different
controls, so I can't set the defaultfocus in the master page.

"Phillip Williams" wrote:
Yes, you put the form on the master page:
http://msdn2.microsoft.com/en-us/lib...hh(VS.80).aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"lanem" wrote:
Do you put your form on the master page or in each individual page? I use a
master page for most of my site. Should the form tag be in the master page?
Thanks.

Mar 29 '06 #3
You can still do manipulations of the objects on the master page from the
content page. Refer to this article for detail:
http://msdn2.microsoft.com/en-us/library/c8y19k6h.aspx

As for setting the default focus, it was discussed in serveral threads on
this forum, just search for "DefaultFocus" or "DefaultButton". Basically
instead of setting the property named DefaultFocus to a value, you would find
the control within the form and call its focus() method programmatically, e.g.

HtmlForm frmForm1 = (HtmlForm)Master.FindControl("form1");
TextBox txt1 = (TextBox)frmForm1.FindControl("TextBox1");
txt1.Focus();

http://msdn2.microsoft.com/en-us/library/ms178232.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"lanem" wrote:
Sometimes I want to do things in the form tag per the specific page though.
Like, I want to set the defaultfocus in the form on the page, but since the
form is in the master page I can't do that. Each page has different
controls, so I can't set the defaultfocus in the master page.

"Phillip Williams" wrote:
Yes, you put the form on the master page:
http://msdn2.microsoft.com/en-us/lib...hh(VS.80).aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"lanem" wrote:
Do you put your form on the master page or in each individual page? I use a
master page for most of my site. Should the form tag be in the master page?
Thanks.

Mar 29 '06 #4

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

Similar topics

1
2124
by: gilly3 | last post by:
I'd like to use a master page for (nearly) every page in my ASP.NET 2.0 website. I also have some webpages that I'd like to protect by using forms authorization. I have a page that requires...
9
2503
by: Andrew Kidd | last post by:
Hi, I've just been working through several examples of how to create Master pages and then create content pages which are linked, but I cannot see the Master page when I'm viewing the content...
17
3134
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content...
2
3729
by: Rob R. Ainscough | last post by:
I'm using forms authentication along with Master pages -- my authenticated forms reside is a sub-dir (Secure) below the web site root dir. The problem is that any graphics placed on the Master...
2
1618
by: Paul | last post by:
Hello: I am struggling with something that would seem to be very easy. I am using a master page. On the content page (which includes the master page), I have a form with a submit input type...
2
6884
by: Alec MacLean | last post by:
Hi I've just recently upgraded to VS2005 and started using/learning about the Master Pages. I'd like to know if it is possible to have separate web app projects use the master page(s) from...
7
2179
by: Rolf Welskes | last post by:
Hello, Master-Content in asp.net is very powerful. But: I have the following: One Master-Form. 30 Content-Forms which are the webpages used. Each of this content-forms must have own...
4
4514
by: Karthik | last post by:
I am converting all my asp.net pages to asp.net 2.0 for supporting master pages. I get the following error in runtime. A page can have only one server-side Form tag. Description: An...
1
8455
by: sudip2008 | last post by:
When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm This breaks this line from working properly window.opener.document.forms...... How can...
10
2105
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
0
7193
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,...
0
7067
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...
0
7316
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...
0
7449
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...
1
4992
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
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
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
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
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.