Master Page and ASP.Net Form

G

Guest

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?
 
C

clintonG

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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,273
Latest member
DamonShoem

Latest Threads

Top