why browser cache setting affects program behavior? Fix?

Discussion in 'ASP .Net' started by =?Utf-8?B?anVubGlh?=, May 19, 2005.

  1. Hi All,

    I am working on a project that acts as a bridge. It does some checking with
    post xml data, and then redirects the request to an appropriate page.
    However, we find that depends on the browser cache setting (and OS), the
    program behaves differently.

    This is how it should work:
    1. The client program opens a webbrowser control, using navigate2 method to
    post xml data to my aspx pages, eg abc.aspx
    2. My aspx pages process the requests, setup cookies in order for a
    successful redirect to another page ( eg. xyz.asp) on the servers.
    3. I have a hidden hyperlink on the aspx page, and after processing, use
    JavaScript to link.click the hyperlink and do the redirect.
    4. The client browser displays the appropriate page (xyz.asp).

    However, we run into problems. For most of the OS and IE settings, IE Cache
    setting needs to the default setting -- Automatically check newer versions of
    stored page. Otherwise if the cache setting is set to check for every visit,
    the redirect will not work, and instead it post back to the page (abc.aspx)
    instead of going to xyz.asp page. This results into empty post data scenario.

    We also encountered that the IE cache setting has to be set to check for
    every visit in order for it to behave properly.

    It seems the problem is somewhat related to IE cache setting, and maybe
    somehow, we may be able to disable the auto posting back to the page itself
    in my aspx page.

    We will need to have the hyperlink so that when we do a redirect to another
    page, so cookie will be set for xyz.asp page. (response.redirect and
    server.transfer are not reliable for setting cookies)

    My questions are:
    1. What does the browser do under each option in the cache setting? Why
    would it affect the program so?
    2. Is there a way to disable the form post back to itself, how?
    3. If your suggestion is to get rid of the server side hyperlink, what is
    the alternative for redirecting with cookie working?

    Thanks much,
    Junlia
     
    =?Utf-8?B?anVubGlh?=, May 19, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?anVubGlh?=

    Bruce Barker Guest

    1) if you use server.treansfer, you don't need a cookie, get the data you
    pass in the cookie from the posting page

    2) if you want the link to work, when render append a random number or guid
    to the url (ex xyz.asp?n=16546565656). this make the url unique, so the
    cache will not be used.

    -- bruce (sqlwork.com)


    "junlia" <> wrote in message
    news:...
    > Hi All,
    >
    > I am working on a project that acts as a bridge. It does some checking
    > with
    > post xml data, and then redirects the request to an appropriate page.
    > However, we find that depends on the browser cache setting (and OS), the
    > program behaves differently.
    >
    > This is how it should work:
    > 1. The client program opens a webbrowser control, using navigate2 method
    > to
    > post xml data to my aspx pages, eg abc.aspx
    > 2. My aspx pages process the requests, setup cookies in order for a
    > successful redirect to another page ( eg. xyz.asp) on the servers.
    > 3. I have a hidden hyperlink on the aspx page, and after processing, use
    > JavaScript to link.click the hyperlink and do the redirect.
    > 4. The client browser displays the appropriate page (xyz.asp).
    >
    > However, we run into problems. For most of the OS and IE settings, IE
    > Cache
    > setting needs to the default setting -- Automatically check newer versions
    > of
    > stored page. Otherwise if the cache setting is set to check for every
    > visit,
    > the redirect will not work, and instead it post back to the page
    > (abc.aspx)
    > instead of going to xyz.asp page. This results into empty post data
    > scenario.
    >
    > We also encountered that the IE cache setting has to be set to check for
    > every visit in order for it to behave properly.
    >
    > It seems the problem is somewhat related to IE cache setting, and maybe
    > somehow, we may be able to disable the auto posting back to the page
    > itself
    > in my aspx page.
    >
    > We will need to have the hyperlink so that when we do a redirect to
    > another
    > page, so cookie will be set for xyz.asp page. (response.redirect and
    > server.transfer are not reliable for setting cookies)
    >
    > My questions are:
    > 1. What does the browser do under each option in the cache setting? Why
    > would it affect the program so?
    > 2. Is there a way to disable the form post back to itself, how?
    > 3. If your suggestion is to get rid of the server side hyperlink, what is
    > the alternative for redirecting with cookie working?
    >
    > Thanks much,
    > Junlia
    >
     
    Bruce Barker, May 20, 2005
    #2
    1. Advertising

  3. thanks for the suggestions, Bruce,

    Response.redirect and server.transfer just don't work well with cookies. so
    option 1 would not work. We will have to use cookies to get it work.
    otherwise, we will have to change the xyz.asp page, which is way too much
    work.

    the problem we have here seems to be that the aspx page post back to itself,
    instead of redirecting to the link. We don't want the form post back to
    itself.

    Junlia

    "Bruce Barker" wrote:

    > 1) if you use server.treansfer, you don't need a cookie, get the data you
    > pass in the cookie from the posting page
    >
    > 2) if you want the link to work, when render append a random number or guid
    > to the url (ex xyz.asp?n=16546565656). this make the url unique, so the
    > cache will not be used.
    >
    > -- bruce (sqlwork.com)
     
    =?Utf-8?B?anVubGlh?=, May 20, 2005
    #3
    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. Xah Lee
    Replies:
    22
    Views:
    1,185
    Tim Roberts
    Mar 21, 2006
  2. Xah Lee
    Replies:
    23
    Views:
    1,129
    Tim Roberts
    Mar 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,232
    Smokey Grindel
    Dec 2, 2006
  4. DCarroll
    Replies:
    4
    Views:
    176
    Steven Cheng[MSFT]
    Sep 27, 2005
  5. Xah Lee
    Replies:
    21
    Views:
    852
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page