Vault of Thoughts

2006-06-05

Please visit my new blog at vaultofthoughts.net

ASP.NET Server-Side Comments

There is a little known feature in ASP.NET that is called the "Server-Side Comments". What is cool about this feature is that it works server side.



Using Server-Side comment is similar to using Html comment in all respects but one. ASP.NET does not process any content a block commented in such a way.
This may be very usefull if what you want is to temporarily disable some part of the page and that part performs some logic other than rendering itself. Ordinary Html comment will not prevent ASP.NET from including the commented controls in the page life-cycle so your Page_Load methods will fire with Server-Side comments they will not.


Thanks to the this kind of comments you will no longer have to temporarily delete some part of the page just to make it work, because some control was throwing exceptions.


kick it on dotnetkicks.com

If you liked this article why not support its author by making a donation?

0 Comments:

Post a Comment

<< Home