Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 399753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:52:38+00:00 2026-05-12T16:52:38+00:00

I have a page1.aspx: <%@ Register src=uc1.ascx tagname=UcHead tagprefix=uc1 %> and uc1.ascx using the

  • 0

I have a page1.aspx:

<%@ Register src="uc1.ascx" tagname="UcHead" tagprefix="uc1" %>

and uc1.ascx using the OutputCache:

<%@ OutputCache Duration="18000" VaryByParam="*"  %> 

How can I click a button in another page2.aspx to remove OutputCache for uc1.ascx or page1.aspx?

When the OutputCache is in page1.aspx, I can use the following code to remove the OutputCache:

string url = "/page1.aspx"; 
HttpResponse.RemoveOutputCacheItem(url); 

But it does not work when the OutputCache is in uc1.ascx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:52:38+00:00Added an answer on May 12, 2026 at 4:52 pm

    Ok try this

    In the page load of your user control put:

    HttpRuntime.Cache.Insert("myCacheKey", DateTime.Now);
    
    BasePartialCachingControl pcc = Parent as BasePartialCachingControl;
    pcc.Dependency = new CacheDependency(null, new string[]{"myCacheKey"});
    

    Change the key to whatever you want it to be for your control.

    Then in the code of the event that you want to clear the cache put:

    Cache.Insert("myCacheKey", DateTime.Now);
    

    I saw this solution at http://dotnetslackers.com/ASP_NET/re-63091_ASP_NET_clear_user_control_output_cache.aspx

    I tested it and it seems to work, although I do have to refresh the page once again after I call this like to see the updated control content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application where I am doing a Response.Redirect(Register.aspx) page in a
I have an Asp .net page like this simple one http://issamsoft.com/app2/page1.aspx and I want
I have page (Default1.aspx) in which I am redirecting to another page (Default2.aspx) using
I am struggling to get my LogIn/Registering system working. I have a register.aspx page
I have a master page ,A page(aspx) and A control(ascx) error messages I am
In Register.aspx.cs i have that code: protected void Page_Load(object sender, EventArgs e) { if
I am using Telerik Radgrid for my aspx page. I have uploaded the screenshot
I developed very simple web site, I have onle three web pages. Logon.aspx Register.aspx
I have a web page (.aspx) that calls a third party web service to
i have 2 pages : Login.aspx and Satis.aspx. i redirected from Login.aspx to Satis.aspx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.