Problem accessing controls in hidden panel

K

Kevin Le

Hi all,

I have problem accessing controls in a hidden panel.

I have Control1 in Panel1. If Panel1 visible="true" then I can get
value from Control1.text but if my Panel1 visible = "false" then my
Control1.text return null.

Does it require some special way to access controls in hidden panel or
is it possible to access child controls of hidden panel at all? Please
help.

Thanks,
Kevin
 
S

Sebastian Doroftei

Since the Panel is not visible, the Server does not send it to the
browser. You can check this by viewing the source of the page loaded in
the browser. Since your control is embedded in this Panel, and the Panel
is not written in the Response object by the server, it's obvious that
the control is not written either, so it's null.
 
K

Kevin Le

Sebastian,

Thanks for your reply!

If I want to have a group hidden controls, for example:

<input type="hidden" name="Control_Id" value="">

in some sort of container/panel so that I can hide them from the users
in a single visible property setting (instead of type="hidden" for each
control) but still want to be able to access their values. Is there an
easy way to do it?


Thanks,
Kevin
 
D

Dave

You could simply put them in a table which you hide by setting the style (
VISIBILITY: hidden ) instead of using a control's .Visible property. That
way it will be rendered to the browser but still hidden from view.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top