Hidden Panel Problem

G

Guest

I have a aspx web page with several hidden(visible=false) panels on it.
Depending on the task the user is going to perform I show or hide the
appropriate panel. What I'm discovering is that my controls on the panels are
not firing their events if the panel was initially hidden when the page
loaded.

For instance, i have a panel with a button and a 'onclick' event defined.
The onclick will only work if the panel is intially visible when the page
loads but not if the panel was hidden when the page loaded. I also noticed
this with my drop down list not loading list items either.

Is this behavior by design? If so what should I do to get the events to fire
after making a panel visible after it was hidden initially? Any help is
greatly appreciated!!!
 
E

Eliyahu Goldin

John,

Yes, it is by design. Server controls with Visible=false don't render to the
client and, consequentially, don't come back in postbacks.

Leave Visible=true and hide the panels with css rule display:none.
 
G

Guest

Thanks, that was a lot of help! Everything is working as expected now.
--
John Pryor


Eliyahu Goldin said:
John,

Yes, it is by design. Server controls with Visible=false don't render to the
client and, consequentially, don't come back in postbacks.

Leave Visible=true and hide the panels with css rule display:none.

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


john pryor said:
I have a aspx web page with several hidden(visible=false) panels on it.
Depending on the task the user is going to perform I show or hide the
appropriate panel. What I'm discovering is that my controls on the panels are
not firing their events if the panel was initially hidden when the page
loaded.

For instance, i have a panel with a button and a 'onclick' event defined.
The onclick will only work if the panel is intially visible when the page
loads but not if the panel was hidden when the page loaded. I also noticed
this with my drop down list not loading list items either.

Is this behavior by design? If so what should I do to get the events to fire
after making a panel visible after it was hidden initially? Any help is
greatly appreciated!!!
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top