controls are all null at page_load()

Discussion in 'ASP .Net' started by =?Utf-8?B?a2V2aW4=?=, Jul 31, 2007.

  1. using VS2005

    My masterpage has two panels and two hyperlinks. The initial content aspx
    page is blank.

    The page_load event of the masterpage hides one of the panels based on
    SESSION variables.

    When I press one particular link all controls are null, thus throwing an
    error. The other hyperlink behaves normally.

    The hyperlinks are both declarative with the url being hardcoded.

    Any ideas about where I should be looking?

    Thanks

    --
    kevin...
    =?Utf-8?B?a2V2aW4=?=, Jul 31, 2007
    #1
    1. Advertising

  2. Two ideas:

    1. If you hide controls with Visible=false, they won't come back in
    postbacks.

    2. If you add controls dynamically, you need to do it on each postback.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin


    "kevin" <> wrote in message
    news:...
    > using VS2005
    >
    > My masterpage has two panels and two hyperlinks. The initial content aspx
    > page is blank.
    >
    > The page_load event of the masterpage hides one of the panels based on
    > SESSION variables.
    >
    > When I press one particular link all controls are null, thus throwing an
    > error. The other hyperlink behaves normally.
    >
    > The hyperlinks are both declarative with the url being hardcoded.
    >
    > Any ideas about where I should be looking?
    >
    > Thanks
    >
    > --
    > kevin...
    Eliyahu Goldin, Jul 31, 2007
    #2
    1. Advertising

  3. you got me to thinking....

    I had an UpdatePanel (AJAX) on the masterpage with the ContentPane inside of
    it. I remoed it and put an UpdatePanels on each of the content pages and my
    problems are gone
    --
    kevin...


    "Eliyahu Goldin" wrote:

    > Two ideas:
    >
    > 1. If you hide controls with Visible=false, they won't come back in
    > postbacks.
    >
    > 2. If you add controls dynamically, you need to do it on each postback.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    >
    >
    > "kevin" <> wrote in message
    > news:...
    > > using VS2005
    > >
    > > My masterpage has two panels and two hyperlinks. The initial content aspx
    > > page is blank.
    > >
    > > The page_load event of the masterpage hides one of the panels based on
    > > SESSION variables.
    > >
    > > When I press one particular link all controls are null, thus throwing an
    > > error. The other hyperlink behaves normally.
    > >
    > > The hyperlinks are both declarative with the url being hardcoded.
    > >
    > > Any ideas about where I should be looking?
    > >
    > > Thanks
    > >
    > > --
    > > kevin...

    >
    >
    >
    =?Utf-8?B?a2V2aW4=?=, Jul 31, 2007
    #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. bminder
    Replies:
    1
    Views:
    2,164
    nfedin
    Feb 23, 2004
  2. T-Bone
    Replies:
    0
    Views:
    520
    T-Bone
    Jul 6, 2004
  3. z. f.
    Replies:
    0
    Views:
    557
    z. f.
    Oct 19, 2004
  4. Replies:
    5
    Views:
    26,595
    Mike Schilling
    Mar 29, 2006
  5. rockdale
    Replies:
    1
    Views:
    655
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
Loading...

Share This Page