Link to home
Start Free TrialLog in
Avatar of Feivi99
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!
ASKER CERTIFIED SOLUTION
Avatar of Opalelement
Opalelement

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Feivi99
Feivi99

ASKER

lolol. You're in good form today. I don't know where to look first :-)
You can probably find your tab changing code here: http://forums.asp.net/p/1296454/2520410.aspx
Avatar of Feivi99

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)
Avatar of Feivi99

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.