PC Review


Reply
Thread Tools Rate Thread

Bug? OutputCache directive processed when commented out

 
 
Amil Hanish
Guest
Posts: n/a
 
      25th Aug 2006
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


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      25th Aug 2006
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/
===================================
"Amil Hanish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
commented! nomail@nospam.com Microsoft ASP .NET 2 16th Feb 2007 02:52 PM
OutputCache directive vs Response.Cache.SetCacheability Pete Griffiths Microsoft ASP .NET 0 21st Feb 2006 02:18 PM
Examine items in the ASP.NET cache added using the OutputCache directive Edward Wilde Microsoft ASP .NET 1 10th Dec 2004 01:44 AM
RE: The 'Location' attribute is not supported by the 'OutPutCache' directive????when i set in the directive Andy Mortimer [MS] Microsoft ASP .NET 0 13th Feb 2004 10:32 AM
Commented Code Not Treated As Commented Code Jim Heavey Microsoft ASP .NET 1 2nd Dec 2003 02:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 AM.