Extending TabStrip Tab

B

Brian

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);
}
}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top