title: Request.IsAuthenticated problem with Cache in ASP.NET
body: <p>I'm new in ASP.NET and I have a problem...</p>
  
  <p>When I want to cache I View or an Action like this : </p>
  
  <pre><code>&lt;%@ Page title="" language="C#" masterpagefile="~/Views/Shared/MemberHome.Master" inherits="System.Web.Mvc.ViewPage&lt;IndexViewData&gt;" %&gt;
  &lt;%@ OutputCache duration="400" varybyparam="divId;regionId;page" %&gt; 
  </code></pre>
  
  <p>I know that it cache all data in my page ... But in my page I have a condition like this : </p>
  
  <pre><code> &lt;% if(Request.IsAuthenticated) { %&gt;
                  &lt;a href="/fr/Advertiser/Search"&gt;&lt;img src="/content/images/v_2/bot.jpg" alt="Entreprises liées à vos passions" title="Entreprises liées à vos passions" /&gt;&lt;/a&gt;
              &lt;% } else { %&gt;
                  &lt;a href="/fr/Advertiser/OpenSearch"&gt;&lt;img src="/content/images/v_2/bot.jpg" alt="Entreprises liées à vos passions" title="Entreprises liées à vos passions" /&gt;&lt;/a&gt;
              &lt;% } %&gt;    
  </code></pre>
  
  <p>I dont want to cache this variable : Request.IsAuthenticated ... because some result depend of this condition ... I try the donut caching by scottgu's but it return (I think) just some text not a bool ...
  <a href="http://weblogs.asp.net/scottgu/archive/2006/11/28/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature.aspx" rel="nofollow noreferrer">http://weblogs.asp.net/scottgu/archive/2006/11/28/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature.aspx</a></p>
  
  <p>Now I'm tired to try anything that come to my mind .. can you help me pleaseee! :)</p>
  
  <p>Julien.</p>