H
Hal
I am trying to programmatically build a tabstrip (creating a template
class for my site that contains a tabstrip in the header).
I have a form (as htmlform) to which I am adding controls and html
(via literalcontrol) and I try to add the tabstrip the same way.
'declare and initialize as appropriate:
Dim tsTopNav As Microsoft.Web.UI.WebControls.TabStrip = New
Microsoft.Web.UI.WebControls.TabStrip
Dim tiHome As Microsoft.Web.UI.WebControls.TabItem
'set tabstrip properties
tsTopNav.ID = "tsTopNav"
tsTopNav.AutoPostBack = True
tsTopNav.SepDefaultImageUrl = "/gfx/spacer.gif"
tsTopNav.TabDefaultStyle.Add("background-color:", "#e6e6e6")
tsTopNav.TabDefaultStyle.Add("font-family", "verdana")
etc...
form.Controls.Add(New LiteralControl)
tiHome.Text = "Home"
tsTopNav.Items.Add(tiHome)
and I get
"Object Reference not set to and instance of an object" in the line
where tiHome.text = "Home" happens.
Somehow tiHome is not properly being set up.
Help!
-
Hal
class for my site that contains a tabstrip in the header).
I have a form (as htmlform) to which I am adding controls and html
(via literalcontrol) and I try to add the tabstrip the same way.
'declare and initialize as appropriate:
Dim tsTopNav As Microsoft.Web.UI.WebControls.TabStrip = New
Microsoft.Web.UI.WebControls.TabStrip
Dim tiHome As Microsoft.Web.UI.WebControls.TabItem
'set tabstrip properties
tsTopNav.ID = "tsTopNav"
tsTopNav.AutoPostBack = True
tsTopNav.SepDefaultImageUrl = "/gfx/spacer.gif"
tsTopNav.TabDefaultStyle.Add("background-color:", "#e6e6e6")
tsTopNav.TabDefaultStyle.Add("font-family", "verdana")
etc...
form.Controls.Add(New LiteralControl)
tiHome.Text = "Home"
tsTopNav.Items.Add(tiHome)
and I get
"Object Reference not set to and instance of an object" in the line
where tiHome.text = "Home" happens.
Somehow tiHome is not properly being set up.
Help!
-
Hal