Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > adding tabitem to Tabstrip (ms ie webcontrol question)

Reply
Thread Tools

adding tabitem to Tabstrip (ms ie webcontrol question)

 
 
Hal
Guest
Posts: n/a
 
      10-30-2003
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
 
Reply With Quote
 
 
 
 
Hal
Guest
Posts: n/a
 
      10-31-2003
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)

On Thu, 30 Oct 2003 20:44:13 GMT, Hal
<(E-Mail Removed)> wrote:

>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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a WebControl to a WebControl Steven ASP .Net Web Controls 1 10-13-2008 09:37 PM
Instead WebControl Multipage & Tabstrip lambu76@gmail.com ASP .Net 1 08-26-2005 05:18 PM
Tabstrip WebControl Question Patrick.O.Ige ASP .Net 3 07-12-2005 03:04 PM
tabstrip webcontrol can not work in framework 1.1 Linda wu via .NET 247 ASP .Net 1 05-04-2004 01:18 PM
How to hide Tabstrip Webcontrol tab =?Utf-8?B?TWlrZQ==?= ASP .Net 1 01-23-2004 07:34 PM



Advertisments