Home All Groups Group Topic Archive Search About

Bug? OutputCache directive processed when commented out

Author
25 Aug 2006 5:14 AM
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

Author
25 Aug 2006 5:29 AM
Juan T. Llibre
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/
===================================
Show quote
"Amil Hanish" <amilhan***@hotmail.com> wrote in message
news:uV0GoVAyGHA.2572@TK2MSFTNGP06.phx.gbl...
>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
>

AddThis Social Bookmark Button