Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how outputCache works

Status
Not open for further replies.

josie2007

Technical User
Apr 14, 2007
90
US
<%@ OutputCache Duration="60" VaryByParam="ddLetting; ddLetting;txtDescription" %>

After I add this line of code my paging does not work. I just get stuck until the expiration date to go to the next page. How can I fix this? thanks
 
Thank you Jason for your reply and yes, those are controls and I did correct it like this
<%@ OutputCache Duration="60" VaryByControl="ddLetting;ddLetting;txtDescription;page" %>

but I am not sure why it is not going to the next page when I do selet.It just wait until the duration time expires and go to the next selected page.Can I just add the Id for gridview in the outputCache declerative section ?
 
does it work if you remove the outputcache statment?
I would start by designing the website without output cache and then looking for bottlenecks and start caching at that point.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
yes, if I take out the outpuccache statement, it works fine and goes to the next page when i do select different page.
 
at this point i'm out of ideas.
I have only used OutputCache to store static user controls. I haven't used them with entire pages.

i would google OutputCache and research excatly what's happening. this may lead to more options on how to proceed.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
I believe VaryByControl only works with UserControls. I'm not sure if you are just using this for a web page.

Below is an exerpt I found:

The VaryByControl attribute allows you to cache the output of a user control based on properties in the control. This attribute is required in a user control @ OutputCache directive unless you have included a VaryByParam attribute.

Take for instance the following directive:

<%@ OutputCache Duration="10" VaryByControl="State;Country"
%>




This directive will vary the output of a user control based on the property values of the State and Country controls. When this user control is included in another ASP.Net page, the user control cache is handled separately from the caching directives of the parent page. This notion of caching user controls separately from the ASP.Net page is known as fragment caching.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top