Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabs in a webform 1

Status
Not open for further replies.

ac11nyc

Programmer
Oct 1, 2003
94
US
Does anyone know if you can make an interface in which it looks like you're clicking on tabs to open another page. For instance the Amazon.com site has tabs. Is it possible? If so, where can i find how to do it? thanx
 
Code:
TabStrip1.Items[1].Text = "Hello World";
As a programmer, you should be able to figure out the add/remove part.
 
lv
Thanks ...well sometimes it will work but other times not? I tried it at positions 3 or 4 for the TAB (my actual document has 4 tabs) and sometimes it does not work. I'm not sure if the Tabstrip uses a 0 or 1 index but I have tried both ... I'll still going thru the code to see why though!!!

TabStrip1.Items[3].Text = "Hello World";

but ASLO... How about how to ADD a NEW or REMOVE a TAB dynamically from the TabStrip?

I don't see an ADD METHOD .. please help!!!!!!!!!
 
lv

O Silly me....!!
I got it... I was changing the text for the tab SEPARATOR instead. Your code is fine!! Thanks.

BUt please how do you DYNAMICALLY ADD A NEW TAB or REMOVE an existing tab.

I still can't find an Add Method
 
Code:
using Microsoft.Web.UI.WebControls;

// add new tab
Tab newTab = new Tab();
newTab.Text = "New Tab";
TabStrip1.Items.Add(newTab);

// add new PageView to use by the new tab
PageView newPageView = new PageView();
newPageView.Controls.Add(new LiteralControl("New Page View"));
MultiPage1.Controls.Add(newPageView);

// to remove tab and pageview;
TabStrip1.Items.RemoveAt(0);
MultiPage1.Controls.RemoveAt(0);
Hope this helps.
 
This isn't a relevant question to the original question, but how do you put in the nicely formatted code blocks?

Keith
 
You type a left bracket : '[' then the word 'code' then a right bracket ']'

when you are done with the code block end in the same way with '/code in brackets.

Tek-Tips must have enhanced this feature recently - looks good.

Good job Tek-Tips!


PH
I was walking home one night and a guy hammering on a roof called me a paranoid little weirdo.
In morse code.
-Emo Phillips
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top