RuntimeTabstrip Control
-
Can we design dynamic tabstrip control at runtime without creating tabstrip control at design time? Am trying to do it by adding %@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> at asp.net design page (.aspx) and Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip(); at code behind. Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab(); tab.Text= " ok" ; tab.ID = "1" ; tabControl.Items.Add(tab); Am not getting anything on page. Can somebody help???
rmr
-
Can we design dynamic tabstrip control at runtime without creating tabstrip control at design time? Am trying to do it by adding %@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> at asp.net design page (.aspx) and Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip(); at code behind. Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab(); tab.Text= " ok" ; tab.ID = "1" ; tabControl.Items.Add(tab); Am not getting anything on page. Can somebody help???
rmr
-
You need to add the control to the Page's Control collection Page.Controls.Add(tabControl); regs g00fy
Thanks for the reply. But am not still able to get the tabcontrol. Please help Design : <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> Code : private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip(); Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab(); tab.Text= " ok" ; tab.ID = "1" ; tabControl.Items.Add(tab); Page.Controls.Add(tabControl); } -- modified at 10:20 Wednesday 6th September, 2006
rmr
-
Thanks for the reply. But am not still able to get the tabcontrol. Please help Design : <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %> Code : private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here Microsoft.Web.UI.WebControls.TabStrip tabControl = new Microsoft.Web.UI.WebControls.TabStrip(); Microsoft.Web.UI.WebControls.Tab tab=new Microsoft.Web.UI.WebControls.Tab(); tab.Text= " ok" ; tab.ID = "1" ; tabControl.Items.Add(tab); Page.Controls.Add(tabControl); } -- modified at 10:20 Wednesday 6th September, 2006
rmr
ok i don't have that assembly and have never used it but this code works
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));Page.Controls.Add(table);
}
and this code doesn't work
protected void Page_Load(object sender, EventArgs e)
{
Table table = new Table();
table.Rows.Add(new TableRow());
table.Rows[0].Cells.Add(new TableCell());
table.Rows[0].Cells[0].Controls.Add(new LiteralControl("cell 0"));//Page.Controls.Add(table);
}
hope that helps g00fy