M
moondaddy
I'm using vb.net 1.1 and have a bit of a catch 22 situation. I have a login
and logout button and code. I'm using frames (header, left side menu, and
main where the various pages load). When the user clicks the logout button
in the left side frame this jscript runs:
parent.main.frameElement.src="Logout.aspx"
logout.aspx is a blank page with the code below in the page_load event which
logs the user out and redirects the home page back to the main frame.
FormsAuthentication.SignOut()
UrlHelper.RedirectWithMessage("home.aspx", PageMessage.Logged_Out)
The home.aspx page_load event I have code that needs to execute some of
which is RegisterStartupScript to write and execute code on the client which
changes the general state depending on if the user is logged in or not.
My problem is that the home.aspx page_load event doesn't fire because the
browser is caching an instance of it already. I know that if I insert the
following line of code the home page will never be cached and this code will
always run.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
That's good, but I have large graphics on the home page that I don't want to
have to reload everytime the user navigates back to the home page. I see 2
possible solutions (in theory) but don't know if they can actually work.
1) run a line of code after the one above that tells the images to be cached
even when the page's HttpCacheability is set to NoCache
2)Wrap the images in user controls where I could tell them to be cached
while the control's parent (home.aspx) is not being cached.
What should I do?
Thanks!
and logout button and code. I'm using frames (header, left side menu, and
main where the various pages load). When the user clicks the logout button
in the left side frame this jscript runs:
parent.main.frameElement.src="Logout.aspx"
logout.aspx is a blank page with the code below in the page_load event which
logs the user out and redirects the home page back to the main frame.
FormsAuthentication.SignOut()
UrlHelper.RedirectWithMessage("home.aspx", PageMessage.Logged_Out)
The home.aspx page_load event I have code that needs to execute some of
which is RegisterStartupScript to write and execute code on the client which
changes the general state depending on if the user is logged in or not.
My problem is that the home.aspx page_load event doesn't fire because the
browser is caching an instance of it already. I know that if I insert the
following line of code the home page will never be cached and this code will
always run.
Response.Cache.SetCacheability(HttpCacheability.NoCache)
That's good, but I have large graphics on the home page that I don't want to
have to reload everytime the user navigates back to the home page. I see 2
possible solutions (in theory) but don't know if they can actually work.
1) run a line of code after the one above that tells the images to be cached
even when the page's HttpCacheability is set to NoCache
2)Wrap the images in user controls where I could tell them to be cached
while the control's parent (home.aspx) is not being cached.
What should I do?
Thanks!