WebControl.Style and ViewState

G

Guest

i'm creating a text box dynamically in the page load and on the client side i
use the following script to hide the control

document.getElementById('dynamicText').style.display='none';
document.getElementById('dynamicText').style.visibility='hidden';

after a post back the control is displayed again
i examined the WebControl.Style properties and found that it's not affected
by the client script, so how can i handle this??

thanks in advance,
Mesalem
 
T

Teemu Keiski

Yes, server-side doesn't know about those changes made at client-side. It
needs to be informed somehow if it needs to do something about it.

You would need to provide that info to the server say via hidden form fields
or equivalent (e.g do it during a postback) so that the control can be
hidden at the server (if that's required). otherwise you'd need to rehide it
at the client.
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top