Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Elad Frid #1
Re: Dynamic tabstrip and multipage
Hi
You are right but I'm creating dynamic controls on each multi page
and if I add the "If Not Page.IsPostBack Then" line I will not be able
to find and access the dynamic controls I have created on the multi
page
Here is a new code example:
Private Sub Demo1()
Dim NewTab As Microsoft.Web.UI.WebControls.Tab
Dim NewSeparator As Microsoft.Web.UI.WebControls.TabSeparator
' If Not Page.IsPostBack Then
' Create Tabs
NewTab = New Microsoft.Web.UI.WebControls.Tab()
NewTab.Text = "new tab1"
tsKR.Items.Add(NewTab)
NewSeparator = New
Microsoft.Web.UI.WebControls.TabSeparator()
tsKR.Items.Add(NewSeparator)
NewTab = New Microsoft.Web.UI.WebControls.Tab()
NewTab.Text = "new tab2"
tsKR.Items.Add(NewTab)
' Create pages view
Dim NewPageView1 As New PageView()
NewPageView1.ID = "PageView1"
mpKR.Controls.Add(NewPageView1)
Dim NewPageView2 As New PageView()
NewPageView2.ID = "PageView2"
mpKR.Controls.Add(NewPageView2)
' End If
Dim TextBox9 As New TextBox()
TextBox9.ID = "9"
TextBox9.Style("Top") = "60px"
TextBox9.Style("Left") = "100px"
FindControl("PageView1").Controls.Add(TextBox9)
Dim dropdownlist1 As New DropDownList()
dropdownlist1.ID = "6"
dropdownlist1.Style("Top") = "60px"
dropdownlist1.Style("Left") = "100px"
dropdownlist1.Items.Add("1")
dropdownlist1.Items.Add("2")
dropdownlist1.AutoPostBack = True
FindControl("PageView2").Controls.Add(dropdownlist 1)
End Sub
Elad.
Elad Frid Guest
-
Reg- Dynamic tab strip and Multipage
Tying to create Dynamic tab strip and Multipage using webcontols . Not able to wire the event selectedindexchanged event to tabstrip any sample... -
Create a web tabstrip control
Hi. I need to do a tabstrip custom control for my web apps get the values of the title os the tabs from a xml file. I can render one table os... -
TabStrip controls
Hello, Could anyone recommend a good ASP.NET TabStrip server control? The IE webcontrol requires IE 5.5 and higher but I have to support as... -
problem using Microsoft.Web.UI.Webcontrols Tabstrip
Hello, i have a problem i want to inherit the tabstrip control and derive my own control to be used in my project for some reasons but when i do... -
IE Webcontrols - Tabstrip
So has anyone worked with the IE webcontrols much? I've found that they've come in very handy for Internet Explorer clients ... ON A WINDOWS... -
Scott G. #2
Re: Dynamic tabstrip and multipage
The tab strip keeps track of the tabs in ViewState (via the Items collection I guess); the PageView controls do not; so you either have to split your code in two (add the the tabs when !IsPostback and then add the PageViews each time); or you have to turn off the ViewState for the TabStrip (and if that can't be done then clear the tab strip each time -- you'll probably have to keep track of the active tab when doing things this way).
The way I do this is kinda like this:
protected override void CreateChildControls()
{
FormTabs = new TabStrip();
if (!IsPostBack)
{
foreach (tab-want-to-create)
{
Tab t = new Tab();
FormTabs.Items.Add(t);
}
}
FormPages = new MultiPage();
foreach (page--want-to-create)
{
FormPage.Controls.Add(new PageView());
}
Controls.Add(FormPages);
FormTabs.TargetId = ID of FormPages;
Controls.Add(FormTabs);
}
Scott
"Elad Frid" <felad@walla.co.il> wrote in message news:3ccf753e.0405020741.73ec1f43@posting.google.c om...
Hi
You are right but I'm creating dynamic controls on each multi page
and if I add the "If Not Page.IsPostBack Then" line I will not be able
to find and access the dynamic controls I have created on the multi
page
Here is a new code example:
Private Sub Demo1()
Dim NewTab As Microsoft.Web.UI.WebControls.Tab
Dim NewSeparator As Microsoft.Web.UI.WebControls.TabSeparator
' If Not Page.IsPostBack Then
' Create Tabs
NewTab = New Microsoft.Web.UI.WebControls.Tab()
NewTab.Text = "new tab1"
tsKR.Items.Add(NewTab)
NewSeparator = New
Microsoft.Web.UI.WebControls.TabSeparator()
tsKR.Items.Add(NewSeparator)
NewTab = New Microsoft.Web.UI.WebControls.Tab()
NewTab.Text = "new tab2"
tsKR.Items.Add(NewTab)
' Create pages view
Dim NewPageView1 As New PageView()
NewPageView1.ID = "PageView1"
mpKR.Controls.Add(NewPageView1)
Dim NewPageView2 As New PageView()
NewPageView2.ID = "PageView2"
mpKR.Controls.Add(NewPageView2)
' End If
Dim TextBox9 As New TextBox()
TextBox9.ID = "9"
TextBox9.Style("Top") = "60px"
TextBox9.Style("Left") = "100px"
FindControl("PageView1").Controls.Add(TextBox9)
Dim dropdownlist1 As New DropDownList()
dropdownlist1.ID = "6"
dropdownlist1.Style("Top") = "60px"
dropdownlist1.Style("Left") = "100px"
dropdownlist1.Items.Add("1")
dropdownlist1.Items.Add("2")
dropdownlist1.AutoPostBack = True
FindControl("PageView2").Controls.Add(dropdownlist 1)
End Sub
Elad.
Scott G. Guest
-
Elad Frid #3
Re: Dynamic tabstrip and multipage
Got it, thanks for your help.
Elad.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Elad Frid Guest



Reply With Quote

