Outputcache problems

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=, Feb 15, 2007.

  1. 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
     
    =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=, Feb 15, 2007
    #1
    1. Advertising

  2. 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.

    --
    Milosz


    "Miguel Isidoro" wrote:

    > 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
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Feb 16, 2007
    #2
    1. Advertising

  3. 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

    "Milosz Skalecki [MCAD]" wrote:

    > 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.
    >
    > --
    > Milosz
    >
    >
    > "Miguel Isidoro" wrote:
    >
    > > 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
     
    =?Utf-8?B?TWlndWVsIElzaWRvcm8=?=, Feb 16, 2007
    #3
  4. 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.

    --
    Milosz


    "Miguel Isidoro" wrote:

    > 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
    >
    > "Milosz Skalecki [MCAD]" wrote:
    >
    > > 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.
    > >
    > > --
    > > Milosz
    > >
    > >
    > > "Miguel Isidoro" wrote:
    > >
    > > > 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
     
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Feb 16, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stewart
    Replies:
    4
    Views:
    2,510
    Stewart
    Jun 26, 2003
  2. Natty Gur

    Re: Programatically remove @OutputCache

    Natty Gur, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    778
    Natty Gur
    Jun 26, 2003
  3. Teemu Keiski

    Re: Programatically remove @OutputCache

    Teemu Keiski, Jul 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    Teemu Keiski
    Jul 2, 2003
  4. marshal

    @ OutputCache in usercontrol problem

    marshal, Aug 7, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,375
    Marshal
    Aug 7, 2003
  5. =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=

    Problems with OutputCache declaration in User Control

    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=, Oct 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    549
    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
    Oct 20, 2004
Loading...

Share This Page