WebControl.Style and ViewState

M

Mesalem

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
 
B

Brock Allen

You will need to send something to the server to tell it to do the same thing
that was done in your client javascript. Pehrpas a hidden field of your own?
Page.RegisterHiddenField will gen one for you. Have your script fill this
in and then on the postback inspect it to know how to set the stype on the
server.
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top