Raising events with a tabstrip

B

Bart Schelkens

Hi,

I've created a webusercontrol that contains a tabstrip
(Microsoft.Web.UI.WebControls.TabStrip.
I want to raise the event when the selected index of the tabstrip changes.
I wrote the following code :

Public Event TabIndexChanged(ByVal intSelectedIndex As Int16)

Private Sub TabStrip1_onSelectedIndexChange(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles TabStrip1.SelectedIndexChange
Dim intSelIndex As Integer = (CType(sender,
Microsoft.Web.UI.WebControls.TabStrip)).SelectedIndex
RaiseEvent TabIndexChanged(intSelIndex)
End Sub

The problem is that when I check the value of intSelIndex it always is -1.
What did I do wrong?
Thanks in advance.
 
B

Bart Schelkens

Sara,

the tabstrip needs to perform the autopostback or the event isn't triggered.
So I think that's my problem.

But putting the code inside if page.ispostback= false doesn't work either.
 

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,774
Messages
2,569,599
Members
45,167
Latest member
SusanaSwan
Top