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