473,473 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to cancel OutputCache by a user action ?

Hi,

I have some controls with these:
<%@ OutputCache Duration="500" Shared="true" VaryByParam="None" %>

However, I need that under certain user action, specifically, changing
a value on a dropdownlist with auto-postback, the cache for the control
be cleaned and the content regenerated.

Is there a way to do this ?

Sep 27 '06 #1
3 2994
You should be able to do this with varybyparam="IdOfControl"
This responds to both querystring and formfield items.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"cr************@hotmail.com" wrote:
Hi,

I have some controls with these:
<%@ OutputCache Duration="500" Shared="true" VaryByParam="None" %>

However, I need that under certain user action, specifically, changing
a value on a dropdownlist with auto-postback, the cache for the control
be cleaned and the content regenerated.

Is there a way to do this ?

Sep 27 '06 #2
Thanks for your response, that's what I was trying, but can I reference
a control that is in the master page ?

I ended up doing it using VaryByParam/VaryByCustom, but that's giving
some problems: all of the sudden the cache stop working and I get
freshly generated pages (I put a time string for testing), eventhough I
just have two different versions of the user control.
Some times it works like 10 seconds, other times like 30, other times
like 2 minutes, then stop working and on every refresh I get a newly
generated page.

What external factors could cause the cache to get invalidated like
this case ?


Peter wrote:
You should be able to do this with varybyparam="IdOfControl"
This responds to both querystring and formfield items.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"cr************@hotmail.com" wrote:
Hi,

I have some controls with these:
<%@ OutputCache Duration="500" Shared="true" VaryByParam="None" %>

However, I need that under certain user action, specifically, changing
a value on a dropdownlist with auto-postback, the cache for the control
be cleaned and the content regenerated.

Is there a way to do this ?
Sep 27 '06 #3

In addition to add this to my control:

<%@ OutputCache Duration="5000" VaryByParam="None"
VaryByCustom="lang"%>

Do I need to setup a cache configuration somewhere else ?
This is the only cache reference I have in all my application and
erratic behavior of the cache is driving me nuts, I have disabled
anti-virus and firewall just in case, still no luck. Out of the blue,
the website begins regenerating the page.
I'm using Asp.Net 2.0, VS2005 8.0.50727.42, .Net v2.0.50727, the
problem is in both debug and non-debug mode.
Regards,

cr************@hotmail.com wrote:
Thanks for your response, that's what I was trying, but can I reference
a control that is in the master page ?

I ended up doing it using VaryByParam/VaryByCustom, but that's giving
some problems: all of the sudden the cache stop working and I get
freshly generated pages (I put a time string for testing), eventhough I
just have two different versions of the user control.
Some times it works like 10 seconds, other times like 30, other times
like 2 minutes, then stop working and on every refresh I get a newly
generated page.

What external factors could cause the cache to get invalidated like
this case ?


Peter wrote:
You should be able to do this with varybyparam="IdOfControl"
This responds to both querystring and formfield items.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"cr************@hotmail.com" wrote:
Hi,
>
I have some controls with these:
<%@ OutputCache Duration="500" Shared="true" VaryByParam="None" %>
>
However, I need that under certain user action, specifically, changing
a value on a dropdownlist with auto-postback, the cache for the control
be cleaned and the content regenerated.
>
Is there a way to do this ?
>
>
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Hautzendorfer | last post by:
Hello, I'm currently working on some printing stuff: I have to print out several .xml files using a stylesheet. Therefor I choose the Internetexplorer PlugIn via SHDocVW. My problem: After...
1
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a...
6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
0
by: Bob | last post by:
I have several simple user controls (e.g. header, footer) that have static content so I thought it would be a good idea to turn on the ouput cache. So I added <%@ OutputCache Duration="600"...
0
by: Vassilis T. via .NET 247 | last post by:
The following piece of code, when on a heavily loaded server (more than 50 ASP.NET pages, most using outputcache with varybyparam, lots of users), will only cache the string - the output is not...
1
by: Barbara Alderton | last post by:
I have the following scenario: I have a user control that contains a registered menu control. The menu and other information on the user control is specific to the user accessing the site. ...
1
by: Johan Nedin | last post by:
Hello! I am having a problem with the @OutputCache page directive and Web browser Back Buttons. Problem: After setting <%@ OutputCache Location="None" %> on my pages I get the "Warning!...
3
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user....
3
by: Question123 | last post by:
Hello I have a .Net 2.0 site and am investigating caching. Using the OutputCache directive seems to work well but there is one thing I am unsure of. Consider two website users UserA & UserB. ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.