473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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("myvar") 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 1612
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.microsoft.com
// specific to the question of referencing a control in a Master Page
referencing controls in master page site:msdn2.microsoft.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**@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.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("myvar") 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**@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.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("myvar") 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
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...
3
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
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...
2
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...
0
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...
4
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: ...
4
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...
6
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#"...
5
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.