Setting the visibilty of server controls

A

Anita C

Hi,
I am using code as follows:
ddNewProperty.Attributes["onfocus"]="document.getElementById('" +
lblSelectedProperty.ClientID + "').style.visibility =hidden; ";
to set the visibility of the above and different server controls such as
textboxes and dropdownlists on my webform, but to no avail. Can someone
please point out the mistake in my code?
Thanks in advance
 
A

Alvin Bruney [MVP]

try document.all.controlnamehere.styles.display = 'none' or '' i forget
which one, one turns it off the other turns it back on. if it is a server
side control, you need only do servercontrol.visible = false;
 
F

Felbrigg

Why are you trying to do it this way. Are you trying to do this in
Javascript on the client? It can be done very easily serverside like
this...

lnkbtnGo.Visible = false;
 

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
474,093
Messages
2,570,607
Members
47,227
Latest member
bluerose1

Latest Threads

Top