473,800 Members | 3,038 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 2020
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 "DefaultFoc us" 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 programmaticall y, e.g.

HtmlForm frmForm1 = (HtmlForm)Maste r.FindControl(" form1");
TextBox txt1 = (TextBox)frmFor m1.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
2146
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 authenticated users, so I've dropped it in a virtual application with a web.config that denies access to anonymous users like so:
9
2519
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 page in "Design", nor do I see it when I'm viewing the page in the browser. I'm adding the Master page through the Add New Item dialog, and creating Web Forms with the "Select Master Page" option checked, then selecting the Master page from the...
17
3163
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 pages? Kinda sorta a critical point no? Am I missing something? Rob. P.S. the day I find a book that actually is useful rather than just a
2
3753
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 page do NOT appear in any of the web forms located in my Secure dir, however, any forms off the root of my web app will display the master page with the graphics. Is there some trick to get master pages to work with forms authentication of forms...
2
1628
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 button. Then, within the IsPostback section of Page_Load, I try to read the value of
2
6901
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 their "parent" site. E.g.: Main site at http://localhost/mainsite/
7
2194
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 html-Head-informations. Example Master: <head>
4
4541
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 unhandled exception occurred during the execution of the current web request. Please review the stack trace for more
1
8488
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 I fix this and display the date into textbox after selecting the date from Calendar.aspx? This Very Urgent .......................... If any body help me out I have given the following Code ******************************
10
2148
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 Master pages as their master...) the entire page is refreshed - also the menu which belongs to the master, how can I fix it - so only the inside content will be refreshed ?
0
9550
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
10273
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10032
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...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
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
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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 we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
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.