Master Page and ASP.Net Form

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bA==?=, Jun 20, 2006.

  1. 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?
    =?Utf-8?B?UGF1bA==?=, Jun 20, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?UGF1bA==?=

    clintonG Guest

    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" <> wrote in message
    news:...
    > 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?
    >
    >
    clintonG, Jun 21, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?UGF1bA==?=

    clintonG Guest

    This article is being considered as the best write-up so far...
    http://odetocode.com/Articles/450.aspx

    <%= Clinton Gallagher



    "Paul" <> wrote in message
    news:...
    > 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?
    >
    >
    clintonG, Jun 21, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    987
    William Brogden
    Aug 5, 2004
  2. Replies:
    1
    Views:
    3,187
    PeterKellner
    May 16, 2006
  3. Zeba
    Replies:
    1
    Views:
    474
    Mark Rae
    Feb 22, 2007
  4. Nathan Sokalski
    Replies:
    25
    Views:
    1,398
    Nathan Sokalski
    Mar 4, 2010
  5. SerpentKiss2010
    Replies:
    0
    Views:
    2,468
    SerpentKiss2010
    Apr 6, 2011
Loading...

Share This Page