Tuesday, April 24, 2012

Tips Comment ASPNET Controls

Some times ASPNET Developer do mistake by commenting server controls
as html comment like below:
<!--<aspnet:TextBox runat="server" id="txt"/>

-->

This comment will affect only by rendering tags as commented html, but doesn't affect its server side events and validations. which
will cause many problems. It is displaying sensitive information, it is vulnerable to cross-site scripting,  failure in firing some scripts like script validation, unexpected behaviour of scripts, and render unwanted tags(affect the performance).

To ignore any of the above problems use server side:
<%--<aspnet:TextBox runat="server" id="txt"/>

--%>

No comments: