Problem programmatically creating tabstrip webcontrol

H

Hal

I hope I'm getting the right group this time.

I am trying to programmatically build a tabstrip (creating a template
class for my site that contains a tabstrip in the header). I'm using
the tabstrip from "Microsoft.web.ui.webcontrol" (iewebcontrols).

I have a form (as htmlform) to which I am adding controls and html
(via literalcontrol) and I try to add the tabstrip as follows:

'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...

'set up tabitem
tiHome.Text = "Home"

'add tabitem to tabstrip
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.

Any ideas?
-
Hal
 
H

Hal

got it... the rather obvious (thought I had tried it and then finally
went back and tried it again out of frustration)

Dim tHome As Microsoft.Web.UI.WebControls.Tab = New
Microsoft.Web.UI.WebControls.Tab

tstopnav.items.add(tHome)
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top