Quote:
Originally Posted by smack
one of my favorite CSS tricks is when using it in conjunction with ASP.NET to show/hide controls.
those of you who work with .NET know that if you set the visible property of a server control to false, it won't render to the browser at all, so you can't make it visible without using a postback.
so what i like to do is leave the visible property as true, but during the page load add a "display: none" CSS attribute to the control, then use a javascript to change that to "display: inline" on the client side so i can avoid at least one more trip back to the server.
makes the page much smoother since the show/hide is all done client side.
|
Indeed, I do this quite a bit... now I also add in some AJAX to streamline things even further using this same method.
Great tip
