Using tabstrip in a user control

Discussion in 'ASP .Net Web Controls' started by Adwait Ullal, Nov 22, 2004.

  1. Adwait Ullal

    Adwait Ullal Guest

    Adwait Ullal, Nov 22, 2004
    #1
    1. Advertising

  2. Adwait Ullal

    Adwait Ullal Guest

    Leon:

    I am familiar with the usage of control however I am looking at using the
    TabStrip control in a custom user control (ascx).

    When I tried it, I got an error, which I will post tomorrow since I don't
    have it available at the moment.

    - Adwait

    "Leon Friesema" wrote:

    > On Mon, 22 Nov 2004 11:42:29 -0800, Adwait Ullal
    > <> wrote:
    >
    > >Hello:
    > >
    > >Does anyone have a sample of using the Microsoft TabStrip control in a
    > >custom user control (ascx) ?
    > >
    > >Please share code and/or URLs.
    > >
    > >Thanks in adance
    > >
    > >- Adwait

    >
    > - Compile using the readme.txt (using some alterations, but you'll get
    > there)
    > - Add the new DLL to the bin folder
    > - Copy the Webctrl_client folder to the solution if necessary. The
    > ..htc and image files need to be publicly available.
    > - Add microsoft.web.ui.webcontrols to your references (don't know for
    > sure if that is necessary, but do it anyway)
    >
    > - Add the following line to the top of the control:
    >
    > <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
    > Assembly="Microsoft.Web.UI.WebControls" %>
    >
    >
    >
    > - You could use this (never mind the Dutch words) in the control HTML
    > designer
    >
    >
    > <ie:TabStrip id="TabStrip1" runat="server"
    > AutoPostBack="True"
    > TabDefaultStyle="background-color:#0000CC;font-family:verdana;font-weight:bold;font-size:8pt;color:#ffffff;width:85;height:21;text-align:center"
    > TabHoverStyle="background-color:#777777"
    > TabSelectedStyle="background-color:silver;color:dimgray;border:1px
    > solid black;">
    > <ie:Tab Text="Nieuw"></ie:Tab>
    > <ie:Tab Text="Open"></ie:Tab>
    > <ie:Tab Text="Wachtende"></ie:Tab>
    > <ie:Tab
    > Text="Volgende versie "></ie:Tab>
    > <ie:Tab Text="Gesloten"></ie:Tab>
    > </ie:TabStrip></P>
    >
    > - Go to design mode; double click on your new tabStrip and a new event
    > is created. etc.etc.
    >
    > Leon.
    >
     
    Adwait Ullal, Nov 24, 2004
    #2
    1. Advertising

  3. Adwait Ullal

    Adwait Ullal Guest

    Here is my TabStripHome.ascx:

    <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
    Assembly="Microsoft.Web.UI.WebControls" %>
    <%@ Register TagPrefix="uctab" TagName="tabStripHome"
    Src="Controls/tabStripHome.ascx" %>
    <%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false"
    Inherits="CAMSRediLink._default" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>default</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <uctab:tabStripHome id="tabStripHome" runat="server"></uctab:tabStripHome>
    </form>
    </body>
    </HTML>

    Here is the default.aspx:

    <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
    Assembly="Microsoft.Web.UI.WebControls" %>
    <%@ Register TagPrefix="uctab" TagName="tabStripHome"
    Src="Controls/tabStripHome.ascx" %>
    <%@ Page language="c#" Codebehind="default.aspx.cs" AutoEventWireup="false"
    Inherits="CAMSRediLink._default" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>default</title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema"
    content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <uctab:tabStripHome id="tabStripHome" runat="server"></uctab:tabStripHome>
    </form>
    </body>
    </HTML>


    And here is the error I get:

    Parser Error
    Description: An error occurred during the parsing of a resource required to
    service this request. Please review the following specific parse error
    details and modify your source file appropriately.

    Parser Error Message: The base class includes the field 'tabStripHome', but
    its type (Microsoft.Web.UI.WebControls.TabStrip) is not compatible with the
    type of control (ASP.tabStripHome_ascx).

    Source Error:


    Line 13: <body MS_POSITIONING="GridLayout">
    Line 14: <form id="Form1" method="post" runat="server">
    Line 15: <uctab:tabStripHome id="tabStripHome"
    runat="server"></uctab:tabStripHome>
    Line 16: </form>
    Line 17: </body>


    Source File: c:\inetpub\wwwroot\CAMSRediLink\default.aspx Line: 15


    "Adwait Ullal" wrote:

    > Leon:
    >
    > I am familiar with the usage of control however I am looking at using the
    > TabStrip control in a custom user control (ascx).
    >
    > When I tried it, I got an error, which I will post tomorrow since I don't
    > have it available at the moment.
    >
    > - Adwait
    >
    > "Leon Friesema" wrote:
    >
    > > On Mon, 22 Nov 2004 11:42:29 -0800, Adwait Ullal
    > > <> wrote:
    > >
    > > >Hello:
    > > >
    > > >Does anyone have a sample of using the Microsoft TabStrip control in a
    > > >custom user control (ascx) ?
    > > >
    > > >Please share code and/or URLs.
    > > >
    > > >Thanks in adance
    > > >
    > > >- Adwait

    > >
    > > - Compile using the readme.txt (using some alterations, but you'll get
    > > there)
    > > - Add the new DLL to the bin folder
    > > - Copy the Webctrl_client folder to the solution if necessary. The
    > > ..htc and image files need to be publicly available.
    > > - Add microsoft.web.ui.webcontrols to your references (don't know for
    > > sure if that is necessary, but do it anyway)
    > >
    > > - Add the following line to the top of the control:
    > >
    > > <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
    > > Assembly="Microsoft.Web.UI.WebControls" %>
    > >
    > >
    > >
    > > - You could use this (never mind the Dutch words) in the control HTML
    > > designer
    > >
    > >
    > > <ie:TabStrip id="TabStrip1" runat="server"
    > > AutoPostBack="True"
    > > TabDefaultStyle="background-color:#0000CC;font-family:verdana;font-weight:bold;font-size:8pt;color:#ffffff;width:85;height:21;text-align:center"
    > > TabHoverStyle="background-color:#777777"
    > > TabSelectedStyle="background-color:silver;color:dimgray;border:1px
    > > solid black;">
    > > <ie:Tab Text="Nieuw"></ie:Tab>
    > > <ie:Tab Text="Open"></ie:Tab>
    > > <ie:Tab Text="Wachtende"></ie:Tab>
    > > <ie:Tab
    > > Text="Volgende versie "></ie:Tab>
    > > <ie:Tab Text="Gesloten"></ie:Tab>
    > > </ie:TabStrip></P>
    > >
    > > - Go to design mode; double click on your new tabStrip and a new event
    > > is created. etc.etc.
    > >
    > > Leon.
    > >
     
    Adwait Ullal, Nov 24, 2004
    #3
  4. Adwait Ullal

    Adwait Ullal Guest

    Leon:

    Thanks ... that works.

    - Adwait

    "Leon Friesema" wrote:

    > On Wed, 24 Nov 2004 14:01:10 -0800, Adwait Ullal
    > <> wrote:
    >
    > >
    > >Here is my TabStripHome.ascx:

    > [BIG SNIPPET OF CODE #1]
    > >
    > >Here is the default.aspx:

    > [BIG SNIPPET OF CODE #2]
    > >
    > >
    > >And here is the error I get:
    > >

    > [BIG SNIPPET OF STACKTRACE]
    > >
    > >
    > >"Adwait Ullal" wrote:
    > >
    > >> Leon:
    > >>
    > >> I am familiar with the usage of control however I am looking at using the
    > >> TabStrip control in a custom user control (ascx).
    > >>
    > >> When I tried it, I got an error, which I will post tomorrow since I don't
    > >> have it available at the moment.
    > >>
    > >> - Adwait
    > >>
    > >> >

    >
    > My (example) default.aspx
    >
    > <%@ Register TagPrefix="uc1" TagName="tabdebug" Src="tabdebug.ascx" %>
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    > <HTML>
    > <HEAD>
    > ---> etc, etc
    > </HEAD>
    > <body MS_POSITIONING="GridLayout">
    > <form id="Form1" method="post" runat="server">
    > <uc1:tabdebug id="Tabdebug1"
    > runat="server"></uc1:tabdebug>
    > </form>
    > </body>
    > </html>
    >
    >
    > tabdebug.ascx:
    > <%@ Control Language="c#" AutoEventWireup="false"
    > Codebehind="tabdebug.ascx.cs" Inherits="tabdebug"
    > TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
    > <%@ Register TagPrefix="ie" Namespace="Microsoft.Web.UI.WebControls"
    > Assembly="Microsoft.Web.UI.WebControls" %>
    > <ie:TabStrip id="TabStrip1" runat="server"
    > TabSelectedStyle="background-color:silver;color:dimgray;border:1px
    > solid black;"
    > TabHoverStyle="background-color:#777777"
    > TabDefaultStyle="background-color:#0000CC;font-family:verdana;font-weight:bold;font-size:8pt;color:#ffffff;width:85;height:21;text-align:center"
    > AutoPostBack="True">
    > <ie:Tab Text="Tab1"></ie:Tab>
    > <ie:Tab Text="Tab2"></ie:Tab>
    > <ie:Tab Text="Tab3"></ie:Tab>
    > </ie:TabStrip>
    >
    > tabdebug.ascx.cs:
    > ..
    > ..
    > private void InitializeComponent()
    > this.TabStrip1.SelectedIndexChange += new
    > System.EventHandler(this.TabStrip1_SelectedIndexChange);
    > ..
    > ..
    > private void TabStrip1_SelectedIndexChange(object
    > sender, System.EventArgs e)
    > {
    > //DO something here
    > }
    >
    >
    >
    >
    > It seems to me, with the error you're recieving you try to use the
    > TabStrip as some sort of base class.
    > Anyway the example above works, so.
    >
    > gr.Leon.
    >
     
    Adwait Ullal, Nov 26, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flynn Arrowstarr

    TabStrip in User Web Control

    Flynn Arrowstarr, Nov 26, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    399
    Saravana [MVP]
    Nov 27, 2003
  2. Replies:
    1
    Views:
    2,054
    =?Utf-8?B?bWF0Y2hieA==?=
    Jul 20, 2005
  3. Mad Scientist Jr
    Replies:
    0
    Views:
    642
    Mad Scientist Jr
    Mar 22, 2006
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    553
    Jonathan Wood
    Feb 2, 2010
  5. Aaron
    Replies:
    3
    Views:
    213
    cfarahiii
    Jan 27, 2005
Loading...

Share This Page