controls are all null at page_load()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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 said:
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 said:
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
 
Back
Top