Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE Web Controls Tabstrip not firing SelectedIndexChange

Status
Not open for further replies.

mj616

MIS
Jun 23, 2003
73
US
I have a problem getting my Tabstrips SelectedIndexChange Event to fire. Has anyone had this problem before? Or know anything that I can check to see what is happening?

thanks,
MJ
 
Have you solved your problem yet? if not read on....

Are you using IE webcontrols tabstrip?

Have you set the Autopostback = true?

Are you using Codebehind pages?

at the end of the sub do you have the code Handles tabstrip1.SelectedIndexChange ? like this....

Code:
Private Sub TabStrip1_SelectedIndexChange(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabStrip1.SelectedIndexChange



George Oakes
Check out this awsome .Net Resource!
 
I know I set the AutoPostBack to true, yes I'm using the codeBehind page.

Code:
using System; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.HtmlControls; 
using Microsoft.Web.UI.WebControls; 


namespace ASPNET.StarterKit.Commerce { 

public abstract class C_Header : System.Web.UI.UserControl { 
protected Microsoft.Web.UI.WebControls.TabStrip TabStrip1; 
protected System.Web.UI.HtmlControls.HtmlInputImage image1; 

public C_Header() { 
this.Init += new System.EventHandler(Page_Init); 
} 

private void Page_Init(object sender, EventArgs e) { 
// 
// CODEGEN: This call is required by the ASP.NET Web Form Designer. 
// 
InitializeComponent(); 
} 

#region Web Form Designer generated code 
/// Required method for Designer support - do not modify 
/// the contents of this method with the code editor. 
/// </summary> 
private void InitializeComponent() { 
this.TabStrip1.SelectedIndexChange += new System.EventHandler (this.TabStrip1_SelectedIndexChange)); 
this.image1.ServerClick += new System.Web.UI.ImageClickEventHandler(this.image1_ServerClick); 
this.Load += new System.EventHandler(this.Page_Load); 

} 
#endregion 

private void Page_Load(object sender, System.EventArgs e) 
{ 

} 

private void image1_ServerClick(object sender, System.Web.UI.ImageClickEventArgs e) 
{ 

} 

private void TabStrip1_SelectedIndexChange(object sender, System.EventArgs e) 
{ 
if (TabStrip1.SelectedIndex == 1) 
{ 
Response.Redirect ("orderlist.aspx"); 
} 
} 

} 
}

Do you see a problem with the way the "TabStrip1_SelectedIndexChange" function?

Thanks for your help,
MJ
 
I know at the beginning of the coad behind page in VB we have the

Code:
Protected WithEvents TabStrip1 As Microsoft.Web.UI.WebControls.TabStrip
    Protected WithEvents Tabstrip2 As Microsoft.Web.UI.WebControls.TabStrip

I don't know if there is an equivilant code for c#

this allows the codebehind to know about the events from the html part of the page.

but your sub looks correct
I have seen others with the same problem on different forums, however I havnt seen a solution you can ty this forum to see if someone has a solution

Good luck

George Oakes
Check out this awsome .Net Resource!
 
Ive posted on that form and am looking for help there also. The onSelectedIndexChange , is this an event? I don't have an event called onSelectedIndexChange.

Thanks for some thoughts though, I'm pulling my hair out over this one. I just don't know why it wont work, I wish they had a click event or something for tabstrips.

MJ
 
in the html of the tabstrip which looks something like this
Code:
<iecontrols:tabstrip id="TabStrip1" runat="server" TabSelectedStyle="background-color:#ffffff;color:#000000"
				TabHoverStyle="background-color:#d0d0d0;" TabDefaultStyle="background-color:#BABABA;font-family:verdana;font-weight:bold;font-size:8pt;color:#000000;width:100;height:10;text-align:center;"
				AutoPostBack="True" BorderColor="Transparent" BorderStyle="Outset">

add to that the code onSelectedIndexChange="TabStrip1_SelectedIndexChange"

so it would look like this

Code:
<iecontrols:tabstrip id="TabStrip1" runat="server" TabSelectedStyle="background-color:#ffffff;color:#000000"
				TabHoverStyle="background-color:#d0d0d0;" TabDefaultStyle="background-color:#BABABA;font-family:verdana;font-weight:bold;font-size:8pt;color:#000000;width:100;height:10;text-align:center;"
				AutoPostBack="True" BorderColor="Transparent" BorderStyle="Outset"
onSelectedIndexChange="TabStrip1_SelectedIndexChange" 
>

George Oakes
Check out this awsome .Net Resource!
 
The onSelectedIndexChange="TabStrip1_SelectedIndexChange" did not work either. The first time I tried it I got an error because of the Security on SelectedIndexChange so I change the event from Private to Public, I didn't get the error but still won't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top