473,608 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Master Page and ASP.Net Form

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
a form field using the standard request.form("m yvar") syntax. But the value
is blank (even though the form field is a dropdownlist and is impossible to
be blank.

When I look at the source, I notice that the form field id has been changed
(due to the master page I believe).

So what is the solution. Has anyone come across this problem with master
pages and forms?

I have scanned the discussion groups and except for one person, it does not
seem like this has come up?
Jun 20 '06 #1
2 1621
You're confused about the way MasterPages are implemented. The content page
for example does not contain the Master Page. That is bass ackwards in fact.
Use the web to search and find the blogs that document these issues and use
google's site: filter to search for documentation at msdn2.microsoft .com as
the following examples show...

// example must-know...
page life cycle site:msdn2.micr osoft.com
// specific to the question of referencing a control in a Master Page
referencing controls in master page site:msdn2.micr osoft.com

Finally, at design-time enable trace in the content page and use trace as a
reference to learn where in the control tree your control is located. This
becomes imperative when using Master Pages with templated controls used in
content pages.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/
"Paul" <Pa**@discussio ns.microsoft.co m> wrote in message
news:E9******** *************** ***********@mic rosoft.com...
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
a form field using the standard request.form("m yvar") syntax. But the
value
is blank (even though the form field is a dropdownlist and is impossible
to
be blank.

When I look at the source, I notice that the form field id has been
changed
(due to the master page I believe).

So what is the solution. Has anyone come across this problem with master
pages and forms?

I have scanned the discussion groups and except for one person, it does
not
seem like this has come up?

Jun 21 '06 #2
This article is being considered as the best write-up so far...
http://odetocode.com/Articles/450.aspx

<%= Clinton Gallagher

"Paul" <Pa**@discussio ns.microsoft.co m> wrote in message
news:E9******** *************** ***********@mic rosoft.com...
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
a form field using the standard request.form("m yvar") syntax. But the
value
is blank (even though the form field is a dropdownlist and is impossible
to
be blank.

When I look at the source, I notice that the form field id has been
changed
(due to the master page I believe).

So what is the solution. Has anyone come across this problem with master
pages and forms?

I have scanned the discussion groups and except for one person, it does
not
seem like this has come up?

Jun 21 '06 #3

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

Similar topics

7
1948
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage I've created StartDate and EndDate properties, which are basically wrappers around the SelectedDates property from the Calendar control. When I select another date in the Calendar, the page updates normally, but when Page_Load for the content page...
3
2012
by: lanem | last post by:
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.
3
6413
by: ivanpais | last post by:
Hi, I have a Web User Control, Lets say "Foo.ascx", that contains a button "btnFoo". I have a Master Page "Bar.master", that has a label "lblBar". This label is exposed by a public property BarLabelText. I now have a contentpage "FooBar.aspx", where "Bar.master" is the master page and in the content section has the control "Foo.ascx".
2
6970
by: SR | last post by:
I have started a web site using ASP.NET 2.0. I would like to centralize all of my classes in a StyleSheet but I cannot figure out how to link the StyleSheet to a Content Page since there is no header. I tried to put the link tag in the Master page, but the classes are not recognized in the Content Page. How do I use a StyleSheet with the Content Page? TIA
0
2090
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and sets a connection string to the database. The content page has a simple gridview that should show records from the selected database. Initial content page displays data from correct place. first change of dropdownlist correctly updates content...
4
3972
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: hypTabAccount.InnerText = "blah" Now, what I want is the same in a content page that uses the Master Page. I have a Master Type in my Content page:
4
2778
by: Suresh | last post by:
Is there any way to access the custom properties of a master page from the aspx form? I know the custom properties of a master page can be accessed from the aspx.cs partial class by specifying the MasterType directive on the aspx form. My master page will render a custom navigation menu and I'd like to put in the properties of which tab and sub tab to load and other misc style info in the aspx form that can be used by master page.
6
6815
by: mike | last post by:
I'm having a problem getting AJAX working with a master page. I have created a new website using the AJAXControlToolkit template and default.aspx as follows. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/ TR/xhtml11/DTD/xhtml11.dtd">
5
2276
by: xlar54 | last post by:
I have a very simple 2.0 website (framework), that uses a master page...not. I added the default.aspx page as a webcontent form, with the master page as it's master page, but the master page is never displayed. Not sure whats wrong. Below is my code. Any help would be appreciated. VS2008. MasterPage1.Master: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage1.master.cs"
0
8063
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
8002
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
8496
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
8475
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...
1
8148
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6816
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...
1
6013
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
4024
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1594
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.