Bug? OutputCache directive processed when commented out

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
 
J

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" --%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top