Firing of Events

axum

Active member
Joined
Mar 28, 2003
Messages
40
Hi all, new to here...

I have a tabstrip control on my page, this has a SelectedIndexChange event associated to it, which works fine.

But of course the Page_Load gets run first. All i need to know is how i can (if it all) identify that its the Tabstip control thats been clicked on to initiate the PostBack.

So something like:

if (tabstrip.SelectedIndexChange == true)
{
do something
}

but obviously i dont know how to write it properly!

or maybe

if (if_tabstrip_was_clicked == true)

hope you get what im trying to ask...

Thanks

Axum
 
Axum:
How about this? Since you know the "SelectedIndexChanged" routine for the TabStrip control is working properly, why not dimension a boolean variable called "myTabClicked" (or something like that). Everytime the user clicks a tab, in the SelectedIndexChanged routine, set that variable = True. Then in whatever other routine is checking whether or not to do the postback, set the condition based on the variable value. For example:

==============================================
Private Sub TabStrip1_SelectedIndexChanged (...)

myTabClicked=True
blah
blah
blah...

End Sub


Private Sub Page_Load (...)

If myTabClicked Then
SetPostback = True
myTabClicked = False
Else
blah
blah
End If

End Sub
==============================================

Maybe this will work. Although I might be missing something. Good luck. :)
 
Make a function that encapsulates what you want to do when your Tabstrip is clicked. Then call that function from the Tabstrip clicked event (or whatever other event youre using).

If theres some initialization or something, you can still call it from Page_Load, but put it inside a if (!Page.IsPostBack) statement.

Daspoo:
Page_Load is executed before the event, so that wont work.
 
Back
Top