Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem programmatically creating tabstrip webcontrol

Reply
Thread Tools

Problem programmatically creating tabstrip webcontrol

 
 
Hal
Guest
Posts: n/a
 
      10-31-2003
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
 
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 Fri, 31 Oct 2003 04:14:26 GMT, Hal
<> wrote:

>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


 
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
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
adding tabitem to Tabstrip (ms ie webcontrol question) Hal ASP .Net 1 10-31-2003 05:12 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57