Extending TabStrip Tab

Discussion in 'ASP .Net Web Controls' started by Brian, Mar 21, 2005.

  1. Brian

    Brian Guest

    I'm attempting to add my own attributes to a TabStrip Tab.
    I think I've overriden the Tab with my own ExtendedTab class.
    My new attributes appear in vs.net intellisense and my new extended
    class gets called, my accessors are called and my Tabs are successfully
    added to my TabStrip. I've also overriden the AddAttributesToRender
    method.

    They still are not rendered when I view the page source. I've done the
    same thing with the TreeView and that works fine. When I debug in the
    ide, my overriden AddAttributesToRender method never seems to get
    called as it does when I did the same thing in the Treeview control.
    The following is the code. Any help would be great.

    public class content : System.Web.UI.Page
    {
    protected TabStrip ContentTabStrip;
    protected ExtendedTab ContentTab;

    private void Page_Load(object sender, System.EventArgs e)
    {
    ContentTab = new ExtendedTab();
    ContentTab.MyAttribute = "MyAttributeValue";
    ContentTabStrip.Items.Add(ContentTab);
    }
    }

    public class ExtendedTab : Tab
    {
    public ExtendedTab() {}

    #region Accessors
    private string _MyAttribute;

    public string MyAttribute
    {
    get { return _MyAttribute; }
    set { _MyAttribute = value; }
    }
    #endregion

    protected override void AddAttributesToRender(HtmlTextWriter writer)

    {
    writer.AddAttribute("MyAttribute", this._MyAttribute);
    base.AddAttributesToRender(writer);
    }
    }
    Brian, Mar 21, 2005
    #1
    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. Natasha

    TabStrip or Tab Controls

    Natasha, Aug 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    412
    Mark Fitzpatrick
    Aug 21, 2003
  2. Do
    Replies:
    0
    Views:
    471
  3. =?Utf-8?B?TWlrZQ==?=

    How to hide Tabstrip Webcontrol tab

    =?Utf-8?B?TWlrZQ==?=, Jan 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,042
    Teemu Keiski
    Jan 23, 2004
  4. ravi bommineni via .NET 247

    How do I know which tab is selected in IE Tabstrip Control

    ravi bommineni via .NET 247, Jun 9, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    140
    David
    Jun 9, 2004
  5. KevinRug

    looking for tab control / tabstrip in VS 2005 beta2

    KevinRug, May 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    117
    Steve C. Orr [MVP, MCSD]
    May 11, 2005
Loading...

Share This Page