Outputcache problems

G

Guest

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. The search results also allows
refining the search and a search button that performs a postback triggers the
search. Many of the web pages in the web site have an OutputCache directive
and the search results page does not. When I run the first search, results
are fine. The problem is in subsequent searches, from the search results page
or global search (included in every page). The search is performed with the
old value an not with the value the user inserts. How can we have pages in
OutputCache and have forms posting back the actual values and not cached
values like it seems to be the case?

Thanks in advance,
Miguel Isidoro
 
G

Guest

Howdy,

The question is, how do you pass criteria (text entered by user) to the
result page? if you're using querystring but built on client site (through
javascript), everything should be fine (even on cached pages, because
redirect to common result page happens at the client side). Are there any
chances you're redirecting on POSTBACK, with criteria stored in Session or
querystring? (Please note cache manager stores two versions of the page when
any of the VaryByWhatEver attributes are set to off/none, one for
!ISPostBack and another for IsPostBack == true). If i'm not mistaken, you've
created a global search component as a user control (is it cached too?) to do
the redirect with user entered text. So if the page is cached, whatever you
put as criteria, it will be save in cache for first postback, so any next
requests are going to be issued directly from cache. To solve the problem,
use javascript in conjunction with query string to pass values entered by the
user, or see at the partial caching asp.net 2.0 feature. If it doesn't
resolve the issue, please do not hesitate posting some code, so we could help.
 
G

Guest

Hi,

The global search is in fact in a web user control that is not cached. I
can't use javascript since my web application must be accessible and cannot
depend on javascript client code to work, essentially on such an important
function as search. From what I have searched and you confirmed, the only is
not to use Outputcache. Any other suggestions?

Another thing and a thing that I don't understand is one thing: my results
search page that also allows an advanched search is not in outputcache. When
I try a new search from it and submit the search (a postback to the same web
page - the search results page), the page is not reloaded (page_load and
other page events are not executed). If the page is not in outputcache, how
can this be?

Thanks in advance,
Miguel
 
G

Guest

Hi there again,

Did you switch to 'downlevel' redering with no javascript? If not, please
note javascript is used by default to postback the form. In addition to that,
you won't affect acessibility using javascript to build query string and
redirect from cached pages. Show us some code, so we could come up with an
idea. Remember you may use partial caching ne feature in ASP.NET 2.0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top