Welcome Guest Search | Active Topics | Sign In | Register

Loading content on demand with TabStrip Options
Ed Jones
Posted: Thursday, August 30, 2007 6:45:32 AM
Rank: Newbie
Groups: Member

Joined: 8/7/2007
Posts: 6
I'm sure this is really simple and I'm missing something obvious but....

I have a tab strip which moved between pageviews when you click on a tab. Ideally when a user clicks on a tab I want to do some server side processing to populate the pages controls with values.

I naturally assumed in the Page_Load sub I could use this code:

Code: Visual Basic.NET
If Me.TabStrip1.SelectedIndex = 2 Then
            Populate_Controls(...)
        End If

However, the value for SelectedIndex is always -1 regardless to the tab selected, thus making it so I can't work out which tab was clicked. Could you give me some pointeres on how to run server side code as to when a tab is clicked? A different function/sub per tab would be fine.

Thanks
Ed
eo_support
Posted: Thursday, August 30, 2007 6:50:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi Ed,

You can handle TabStrip_ItemClick event. Inside that event you can use:

if e.TabItem.Index == 2 Then
.....

That should give you the correct value. Note you may need to use CType(e.NavigationItem, EO.Web.TabItem).Index because property e.TabItem has only been added very recently.

Thanks
Ed Jones
Posted: Thursday, August 30, 2007 6:57:05 AM
Rank: Newbie
Groups: Member

Joined: 8/7/2007
Posts: 6
Sorry I'm being a bit thick, could you give me the full sub declaration?
eo_support
Posted: Thursday, August 30, 2007 7:26:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Here you go:

Code: Visual Basic.NET
Private Sub TabStrip1_ItemClick(
    sender As Object, e As EO.Web.NavigationItemEventArgs) 
    Handles TabStrip1.ItemClick
    If e.TabItem.Index = 2 Then
         ...do something.....
    End If
End Sub 'TabStrip1_ItemClick


Thanks
Ed Jones
Posted: Thursday, August 30, 2007 7:36:15 AM
Rank: Newbie
Groups: Member

Joined: 8/7/2007
Posts: 6
Many thanks, that works a treat.

Ed


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.