Thursday, February 5, 2009

Manage Control Visibility Using CSS in Server Side

There are some situations we make our controls visibility to false in our page load and try to access that very same control in JavaScript. Since its visibility is set false, that control wont be rendered in the HTML and the poor JavaScript could not find that element.
Instead of using ‘Visible’ property we can use CSS to get that work done. It will make the control invisible and at the same time, using JavaScript, we can able to find that control as well. Code snippet shown below.

0 comments: