Connecting Tech Pros Worldwide Forums | Help | Site Map

strange problem possibly related to caching

Gav
Guest
 
Posts: n/a
#1: Nov 15 '05
Hi all,

I'm having this strange problem where, in a web app, I have 2 different
links to a different form. One is just a straight forward link the other is
a bit more complicated because it gets there from a user control I wrote to
display a menu. However both call the page in the same way using
window.open('page.aspx','_top');

The problem is that:.... The page it calls, in the page load, checks to see
if a session variable is null, if it is it shows a error message and sends
the user back. This works fine the first time you click it exactly how it
should work. however if you click the link in the menu when the var is null
I get sent back then if I click the same link when the var is not null I
still get the error message and get sent back!! however if I click the
straight forward link the page loads. Even after I have the page I can go
back manually click the link in the menu and still get the same error. When
trying to debug it doesn't when clicking the menu option which makes me
believe it has something to do with caching. Although I have;
<META http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT"> which I
believe should make it expire straight away so therefore always reload
itself.

Hope somebody can help me out? Let me know if you need more info

Regards
Gavin



Tom Carter
Guest
 
Posts: n/a
#2: Nov 15 '05

re: strange problem possibly related to caching


Gav,

If you are using the window.open function then a new window would be
opened by javascript. A new window has no back/forward page so I am
not sure about some part of your issue.

Since you are using the window.open function each time I am not sure
you will benefit from the cache..

Does your control generate a postback? if it does is the variable
check being done each and every time? if it is you should be able to
put a break point into the code and discover what is not firing.

Lastly, check your html code generated in each instance (first &
second clicks of the control) -- look for differences and possibly
missing html on the second click. Too often we forget that asp.net
just sets up valid html/javascript -- if that underlying code is
incorrect you can trace the cause back to the asp/c# logic.

--
~~~~~~~~~~~~~
Tommie Carter
--

"Gav" <spam@spam.com> wrote in message news:<#E57eVQ1DHA.2116@TK2MSFTNGP10.phx.gbl>...[color=blue]
> Hi all,
>
> I'm having this strange problem where, in a web app, I have 2 different
> links to a different form. One is just a straight forward link the other is
> a bit more complicated because it gets there from a user control I wrote to
> display a menu. However both call the page in the same way using
> window.open('page.aspx','_top');
>
> The problem is that:.... The page it calls, in the page load, checks to see
> if a session variable is null, if it is it shows a error message and sends
> the user back. This works fine the first time you click it exactly how it
> should work. however if you click the link in the menu when the var is null
> I get sent back then if I click the same link when the var is not null I
> still get the error message and get sent back!! however if I click the
> straight forward link the page loads. Even after I have the page I can go
> back manually click the link in the menu and still get the same error. When
> trying to debug it doesn't when clicking the menu option which makes me
> believe it has something to do with caching. Although I have;
> <META http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT"> which I
> believe should make it expire straight away so therefore always reload
> itself.
>
> Hope somebody can help me out? Let me know if you need more info
>
> Regards
> Gavin[/color]
Alvin Bruney
Guest
 
Posts: n/a
#3: Nov 15 '05

re: strange problem possibly related to caching


Post your relevant code snippets, the problem is unclear to me from your
explanation.

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/2bz4t
"Gav" <spam@spam.com> wrote in message
news:%23E57eVQ1DHA.2116@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi all,
>
> I'm having this strange problem where, in a web app, I have 2 different
> links to a different form. One is just a straight forward link the other[/color]
is[color=blue]
> a bit more complicated because it gets there from a user control I wrote[/color]
to[color=blue]
> display a menu. However both call the page in the same way using
> window.open('page.aspx','_top');
>
> The problem is that:.... The page it calls, in the page load, checks to[/color]
see[color=blue]
> if a session variable is null, if it is it shows a error message and sends
> the user back. This works fine the first time you click it exactly how it
> should work. however if you click the link in the menu when the var is[/color]
null[color=blue]
> I get sent back then if I click the same link when the var is not null I
> still get the error message and get sent back!! however if I click the
> straight forward link the page loads. Even after I have the page I can go
> back manually click the link in the menu and still get the same error.[/color]
When[color=blue]
> trying to debug it doesn't when clicking the menu option which makes me
> believe it has something to do with caching. Although I have;
> <META http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT"> which[/color]
I[color=blue]
> believe should make it expire straight away so therefore always reload
> itself.
>
> Hope somebody can help me out? Let me know if you need more info
>
> Regards
> Gavin
>
>[/color]


Gav
Guest
 
Posts: n/a
#4: Nov 15 '05

re: strange problem possibly related to caching


This was a problem to do with caching...because the window.open had '_top'
in the statement it opens it in the current window instead of opening a new
one. Although I was putting the expires tag in, it was writing the
history.back in the Page_load event so it was going back a page before it
wrote the <meta> tag into the page. Just had to make sure I wrote that
first.

Thanks for the help

"Alvin Bruney" <vapor at steaming post office> wrote in message
news:%23%23t0NRW1DHA.2408@tk2msftngp13.phx.gbl...[color=blue]
> Post your relevant code snippets, the problem is unclear to me from your
> explanation.
>
> --
> Regards,
> Alvin Bruney
> Got tidbits? Get it here...
> http://tinyurl.com/2bz4t
> "Gav" <spam@spam.com> wrote in message
> news:%23E57eVQ1DHA.2116@TK2MSFTNGP10.phx.gbl...[color=green]
> > Hi all,
> >
> > I'm having this strange problem where, in a web app, I have 2 different
> > links to a different form. One is just a straight forward link the other[/color]
> is[color=green]
> > a bit more complicated because it gets there from a user control I wrote[/color]
> to[color=green]
> > display a menu. However both call the page in the same way using
> > window.open('page.aspx','_top');
> >
> > The problem is that:.... The page it calls, in the page load, checks to[/color]
> see[color=green]
> > if a session variable is null, if it is it shows a error message and[/color][/color]
sends[color=blue][color=green]
> > the user back. This works fine the first time you click it exactly how[/color][/color]
it[color=blue][color=green]
> > should work. however if you click the link in the menu when the var is[/color]
> null[color=green]
> > I get sent back then if I click the same link when the var is not null I
> > still get the error message and get sent back!! however if I click the
> > straight forward link the page loads. Even after I have the page I can[/color][/color]
go[color=blue][color=green]
> > back manually click the link in the menu and still get the same error.[/color]
> When[color=green]
> > trying to debug it doesn't when clicking the menu option which makes me
> > believe it has something to do with caching. Although I have;
> > <META http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">[/color][/color]
which[color=blue]
> I[color=green]
> > believe should make it expire straight away so therefore always reload
> > itself.
> >
> > Hope somebody can help me out? Let me know if you need more info
> >
> > Regards
> > Gavin
> >
> >[/color]
>
>[/color]


Jeffrey Tan[MSFT]
Guest
 
Posts: n/a
#5: Nov 15 '05

re: strange problem possibly related to caching



Hi Gav,

Is your problem resolved?
I think Tom Carter's post provide some useful information to you.
If you still have any concern, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Closed Thread