Bug? OutputCache directive processed when commented out

  • Thread starter Thread starter Amil Hanish
  • Start date Start date
A

Amil Hanish

I had an aspx page with output caching turned on. Then I wanted to do some
other stuff and I commented it out like:

<!--
<%@ OutputCache Duration="1800" VaryByParam="t" %>
-->

The IDE correctly shows this as a green comment...but don't be fooled. .NET
still processes and caches the output. In my case, the ClientID values
started being duplicated for a DataList object.

Amil
 
re:
The IDE correctly shows this as a green comment...but don't be fooled. .NET still processes and
caches the output.

No, it doesn't.

Try :

<%--
<%@ OutputCache Duration="1800" VaryByParam="t" %>
--%>

HTML comment code doesn't affect ASP.NET server-side code.
You need to use proper ASP.NET comment marks.

You can also use :
<%-- @ OutputCache Duration="1800" VaryByParam="t" --%>




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Back
Top