Microsoft TabStrip control problem

Last post 05-17-2004 12:06 PM by hotrodtodd. 5 replies.

Sort Posts:

  • Microsoft TabStrip control problem

    04-16-2003, 9:28 PM
    • Member
      390 point Member
    • DrEaMON
    • Member since 02-25-2003, 12:36 PM
    • Oslo, Norway
    • Posts 92
    I'm trying to use the TabStrip control in a UserControl (the page that holds the UserControl has 3 other UserControls also). I have set the TabStrip control's AutoPostBack to true and everything seems ok. However, when I click one of the tabs, nothing happens and I get a JavaScript error. The error: "__TabStrip1_State__" is undefined". I have done a View Source in the browser, and the hidden field named "__TabStrip1_State__" is there. So really, I don't understand why the heck it won't work.

    I have a feeling it has something to do with the fact that I use it inside a UserControl. I tried doing this in a empty aspx page, and I did not get this error.

    Does anyone have experience with this and maybe know how to handle it?

    Thanks!
    I haven't failed, I've found 10,000 ways that don't work
  • Re: Microsoft TabStrip control problem

    08-15-2003, 9:41 AM
    • Member
      5 point Member
    • brianbolger
    • Member since 08-15-2003, 9:38 AM
    • Posts 1
    Hi,

    did you ever get this to work, I'm having the same problem.

    Thanks, B.
  • Re: Microsoft TabStrip control problem

    08-15-2003, 12:02 PM
    • Star
      8,776 point Star
    • JimmyM
    • Member since 08-27-2002, 9:52 PM
    • Austin TX
    • Posts 1,671
    You may need to show some code of how do you set up this TabStrip.
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Microsoft TabStrip control problem

    08-18-2003, 5:43 PM
    • Member
      390 point Member
    • DrEaMON
    • Member since 02-25-2003, 12:36 PM
    • Oslo, Norway
    • Posts 92
    I gave it up actually. But I think that there is (or was maybe) a postback problem with it. I tried in inside a usercontrol only and that didn't work. I'm sure it's not a problem if you use it in a plain aspx page.
    I haven't failed, I've found 10,000 ways that don't work
  • Re: Microsoft TabStrip control problem

    04-26-2004, 10:30 AM
    • Member
      65 point Member
    • ESBertrand
    • Member since 04-28-2003, 4:05 PM
    • Posts 13
    I was getting this as well and was able to fix it by wrapping a FORM tag around the TabStrip and MultiPage controls. The FORM tag must include the "runat=server" tag property.

    These '__[controlname]_State__" controls are ViewState-related, so in order for .NET to create these controls and reference them on PostBack, they must be included inside the form tag. My code that works (no errors when switching between tabs) is below.

    One note: an ASPX must not have more than one form tag with a "runat=server" specified, for obvious reasons. You can have other form tags nested (say, within the MultiPage controls); but they cannot have "runat=server" specified. They shouldn't really need them anyway, at least in most cases.

    Hope this helps.

    Erik


    <HTML>
    <HEAD>
    <title>My Company Web Site</title>
    <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
    <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    <LINK href="/style.css" type=text/css rel=stylesheet >
    </HEAD>
    <body leftMargin=0 topMargin=0 rightMargin=0>
    <form id="f1" method="post" runat="server">
    <P><br><ie:tabstrip id=tsGroupAdmin style="FONT-WEIGHT: bold" TabDefaultStyle="border:solid 1px black;background:#dddddd;padding-left:5px;padding-right:5px;" TabHoverStyle="color:red" TabSelectedStyle="border:solid 1px black;border-bottom:none;background:white;padding-left:5px;padding-right:5px;" SepDefaultStyle="border-bottom:solid 1px #000000;" TargetID="mpGroupAdmin" runat="server" EnableViewState="true" AutoPostBack="true">
    <ie:Tab Text="My Plan Information"></ie:Tab>
    <ie:TabSeparator></ie:TabSeparator>
    <ie:Tab Text="Sublocations"></ie:Tab>
    <ie:TabSeparator></ie:TabSeparator>
    <ie:Tab Text="Forms/Reports"></ie:Tab>
    <ie:TabSeparator></ie:TabSeparator>
    <ie:Tab Text="Manage Enrollment"></ie:Tab>
    <ie:TabSeparator DefaultStyle="width:100%;"></ie:TabSeparator>
    </ie:TabStrip><ie:multipage id=mpGroupAdmin style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: medium none; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #000000 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #000000 1px solid" runat="server" Height="100%" Width="100%" EnableViewState="true">
    <ie:PageView>
    <asp:Xml id=xmlMyPlanInfo runat="server"></asp:Xml></ie:PageView>
    <ie:PageView>
    <asp:Xml id=xmlSublocations runat="server"></asp:Xml></ie:PageView>
    <ie:PageView>
    <asp:Xml id=xmlFormsReports runat="server"></asp:Xml></ie:PageView>
    <ie:PageView>
    <asp:Xml id=xmlManageEnrollment runat="server"></asp:Xml></ie:PageView>
    </ie:multipage></P>
    <P>&nbsp;</P>
    </form>

    </body>
    </HTML>

  • Re: Microsoft TabStrip control problem

    05-17-2004, 11:46 AM
    • Member
      15 point Member
    • hotrodtodd
    • Member since 05-17-2004, 7:01 AM
    • Central US
    • Posts 3
    I managed to wrap the TabStrip control in a UserControl that resides in an aspx page along with other UserControls (which were used as pseudo panels). I implemented an event that fires when the selected index of the TabStrip control is changed. There is also a property of SelectedIndex within the UserControl that relays the TabStrip's selected index. The event is registered in the aspx page and executes a page-level method when fired that retrieves the User Control's SelectedIndex property and sets visibility of the other user controls based on that index. This way, since we can only have one Form tag that is designated runat=server, you can include multiple controls without worry and still maintain modularity to a degree. All works well, however, I am experiencing problems using IE's browser navigation buttons (back and forward). I have this page sitting in a framed page on the right side as the left side contains banners and external links. Have not been able to resolve this problem yet so if you have any advice, please post!

    Thanks,
    HRT
Page 1 of 1 (6 items)