Feivi99
asked on
setting default tab through cookie
Hi everyone,
My site has six tabs using the asp.net tabcontainer. I would like, through a checkbox, to let a user be able to set tab six as the default tab that opens up when (s)he visits the site. I imagine I need a cookie to do this? I haven't worked with cookies yet, and don't know how to code this, or whether this should be done server side or with javascript...
I'm using asp.net with C#.
TIA!
My site has six tabs using the asp.net tabcontainer. I would like, through a checkbox, to let a user be able to set tab six as the default tab that opens up when (s)he visits the site. I imagine I need a cookie to do this? I haven't worked with cookies yet, and don't know how to code this, or whether this should be done server side or with javascript...
I'm using asp.net with C#.
TIA!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can probably find your tab changing code here: http://forums.asp.net/p/1296454/2520410.aspx
ASKER
That link enables to set up a default tab, but it would be the same for everyone, not per user. I'm pretty sure that the way to do it is with a cookie. I'll be studying the cookie dough, er, code you've given me to see if I can figure out how to incorporate the tab information..
Well i meant specifically this part:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TabContainer1.ActiveTab = TabContainer1.Tabs(1)
'Take the tab index from session instead. Also, use IsPostBack for better performance
End Sub
I think you can use that for the cookie... Not as-is, but using this line:
TabContainer1.ActiveTab = TabContainer1.Tabs(1)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TabContainer1.ActiveTab = TabContainer1.Tabs(1)
'Take the tab index from session instead. Also, use IsPostBack for better performance
End Sub
I think you can use that for the cookie... Not as-is, but using this line:
TabContainer1.ActiveTab = TabContainer1.Tabs(1)
ASKER
Looking around that site, I found this,
http://forums.asp.net/p/1300797/2919897.aspx#2919897
which is what I was looking for. And yes, it conforms to that other page.
http://forums.asp.net/p/1300797/2919897.aspx#2919897
which is what I was looking for. And yes, it conforms to that other page.
ASKER