After All My Years
-
I have only just found out what this would do:
<!-- <my:control runat="server" /> -->
That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:
<!-- <p>Hello</p> -->
Using a server-side comment, on the other hand, does not cause this problem:
<%-- <my:control runat="server" /> --%>
That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.
-
I have only just found out what this would do:
<!-- <my:control runat="server" /> -->
That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:
<!-- <p>Hello</p> -->
Using a server-side comment, on the other hand, does not cause this problem:
<%-- <my:control runat="server" /> --%>
That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.
-
I'm not sure that's Hall of Shame worthy, seems like quite an understandable mistake to me! (Particularly as the 'commented out' code probably shows in green in your IDE ...)
BobJanova wrote:
I'm not sure that's Hall of Shame worthy, seems like quite an understandable mistake to me! (Particularly as the 'commented out' code probably shows in green in your IDE ...)
I agree. In addition, this can be a good post to the Tip/Trick section.
Good judgment comes from experience, and experience comes from bad judgment. Barry LePatner
-
I have only just found out what this would do:
<!-- <my:control runat="server" /> -->
That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:
<!-- <p>Hello</p> -->
Using a server-side comment, on the other hand, does not cause this problem:
<%-- <my:control runat="server" /> --%>
That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.
Another thing to be aware is that style comment will be sent with the web page while server side comments (using <%-- --%>) are stripped.
Philippe Mori