Thanks Jano..exactly what i was looking for!

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Jano Petras
Sent: Tuesday, 7 September 2010 11:05 PM
To: ozDotNet
Subject: Re: usercontrol caching

 

Hi Anthony,

Yes, that is the "proper" way - if the user control is available in cache it
will not be instantiated, so you should check for null / nothing.

See
http://authors.aspalliance.com/aspxtreme/webapps/cachingportionsofaspnetpage
.aspx

Cheers,
jano

On 7 September 2010 14:57, Anthony <[email protected]> wrote:

Thanks Paul..that does answer my question?  Sugest any tool to use to see
the performance difference when i implement caching.  Would be interesting
to measure the difference in performance!

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Paul Glavich
Sent: Tuesday, 7 September 2010 10:31 PM
To: 'ozDotNet'
Subject: RE: usercontrol caching

 

Not sure I fully understand your question but, while the cache condition is
satisfied, none of your code around that user control code behind will be
executed (which is exactly why the cache is a good thing from  a perf
perspective)

 

ASP.Net takes the HTML result of that user control and stores it *verbatim*
while the cache condition is satisfied. While its being served from cache,
ASP.Net will take that output and simply push it back as the response
without executing any server side code (as far as that control is
concerned).

 

The answer (if I understand what you are asking) as to reduce the cache time
or Vary the cache instance by a param other than UserId.

 

-          Glav

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Anthony
Sent: Tuesday, 7 September 2010 5:17 PM
To: 'ozDotNet'
Subject: usercontrol caching

 

I have a user control  which is set to output cache using the following
command..

 

<%@ OutputCache Duration="1000" VaryByParam="UserId" %>

 

When the usercontrol is being cached the usercontrol is no longer availble
so my code where ... usercontrol.userid=89   fails!

 

Do i just wrap this code in 

 

If usercontrol isnot nothing then

usercontrol.userid=89   

End if

 

Or is there a 'proper' way to do this?

 

Is your <http://www.intellixperience.com/signup.aspx>  website being
IntelliXperienced?  | www.yougoingmyway.com ?
regards
Anthony (*12QWERNB*)

Is your website being IntelliXperienced?

 

 

 

Reply via email to