tab control state

R

Rubble

Hello,

Im using the tab control provided my the ie webcontrols. I really
like it, but I would like to keep the present tab selected when a user
hits back on the browser. Right now, I have the tab control showing
some links. When someone selects a particular tab, then visits the
page, they may hit the back button. If they do that now, it defaults
back to the first tab in the set. Id like for the tab they had
selected to still be selected.

Is this possible?

Thanks,
B. Rubble
 
A

Alessandro Zifiglio

Hitting the back button does not refresh the page but merrily picks up the
page from cache. This is how the browser works on the client, not much you
can do from the server and has nothing to do with your tab control ;P
 
R

Rubble

I figured it would work like a form. For example, if you choose
several options on a form then hit submit...then hit the back button,
your options would still be selected. The page doesnt refresh or
change all the values back to the default, but keeps them the way you
left them.

Could I set the cache on the user side so that it "remembers" the tab
or somehow make the tab function like a form, where the selections
remain unchanged?

Thanks for the advice!
B. Rubble
 
A

Alessandro Zifiglio

Rubble,
When the "BACK" button is clicked, the browser will display the page exactly
as it were when it was previously viewed. This is to comply with the
standards set for browser vendors which states that the browser should not
make another request to a server, but retrieve the page from cache.

Try the following to disable caching. I havent personally tried but the docs
clearly state that : If you set cacheability to HttpCacheability.NoCache or
HttpCacheability.ServerAndNoCache, the requesting client will not cache
pages in its History folder. For example, any time a user clicks a back or
forward button, a new version of the response will be requested.

To programmatically set this try the following in your page_load method:

Response.Cache.SetCacheability(HttpCacheability.NoCache)



or try setting this in your .aspx page which should have the same effect as
the above :
syntax is : <%@ OutputCache Duration="#ofseconds" Location="Any | Client |
Downstream | Server | None" Shared="True | False"
VaryByControl="controlname" VaryByCustom="browser | customstring"
VaryByHeader="headers" VaryByParam="parametername" %>


<%@ OutputCache Duration="1" Location="none" VaryByParam="none" %>

Note where the "Location" attribute is set to none, theorically this should
have the same effect as programmatically setting
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Read the following documentation for details.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconOutputCache.asp

http://msdn.microsoft.com/library/d...guide/html/cpconsettingcacheabilityofpage.asp
 
A

Alessandro Zifiglio

Reposting. I dont see my previous post. Hopefully this wont be another
duplicate ;P

Rubble,
When the "BACK" button is clicked, the browser will display the page exactly
as it were when it was previously viewed. This is to comply with the
standards set for browser vendors which states that the browser should not
make another request to a server, but retrieve the page from cache.

Try the following to disable caching. I havent personally tried but the docs
clearly state that : If you set cacheability to HttpCacheability.NoCache or
HttpCacheability.ServerAndNoCache, the requesting client will not cache
pages in its History folder. For example, any time a user clicks a back or
forward button, a new version of the response will be requested.

To programmatically set this try the following in your page_load method:

Response.Cache.SetCacheability(HttpCacheability.NoCache)



or try setting this in your .aspx page which should have the same effect as
the above :
syntax is : <%@ OutputCache Duration="#ofseconds" Location="Any | Client |
Downstream | Server | None" Shared="True | False"
VaryByControl="controlname" VaryByCustom="browser | customstring"
VaryByHeader="headers" VaryByParam="parametername" %>


<%@ OutputCache Duration="1" Location="none" VaryByParam="none" %>

Note where the "Location" attribute is set to none, theorically this should
have the same effect as programmatically setting
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Read the following documentation for details.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconOutputCache.asp

http://msdn.microsoft.com/library/d...guide/html/cpconsettingcacheabilityofpage.asp
 
R

Rubble

Thanks for the info. Ill give that a try. I would have thought that
when I select a tab then go to the next page, hitting the "BACK"
button would should me the tab I last selected...but for some reason
it defaults to the first tab in the series. I guess disabling the
cache is worth a try.

Thanks!
x B. Rubble x
 
A

Alessandro Zifiglio

your welcome ;)

Rubble said:
Thanks for the info. Ill give that a try. I would have thought that
when I select a tab then go to the next page, hitting the "BACK"
button would should me the tab I last selected...but for some reason
it defaults to the first tab in the series. I guess disabling the
cache is worth a try.

Thanks!
x B. Rubble x

"Alessandro Zifiglio" <[email protected]> wrote in
 

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,888
Messages
2,569,964
Members
46,294
Latest member
HollieYork

Latest Threads

Top