M
mawi
Hello again,
I posted this question without code, here is the code.
Again, the problem is: Viewstate of a pageviews child
controls is not saved as it would be if the control were
child of the page.
Any clues as to how to resolve this in the best way are
greatly appreciated. If one could make a control child of
multiple parents I could use Denis Bauers placeholder, but
afaik that is not possible.
Notice that this will probably not run using vanilla ie
webcontrols code, due to the bug I've posted about recently.
/mawi
Code (save as aspx file in a webroot, put
"Microsoft.Web.UI.WebControls.dll" - preferably bugfixed -
in "bin" directory of that root):
<%@ Page language="c#" AutoEventWireup="true" %>
<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">
void Page_Load()
{
for ( int i = 1; i <= TabStrip1.Items.Count; i++ )
NewPV( i.ToString() );
}
private void addTab(object sender, System.EventArgs e)
{
String count = (TabStrip1.Items.Count + 1).ToString();
Tab t = new Tab();
t.Text = t.ID = "Tab_" + count;
PageView pv = NewPV( count );
t.TargetID = pv.ID;
pv.Controls.Add( new Label() );
( pv.Controls[ 1 ] as Label ).Text = "Persist this!!";
TabStrip1.Items.Add( t );
}
private PageView NewPV( String count )
{
PageView pv = new PageView();
pv.Controls.Add( new Literal() );
( pv.Controls[ 0 ] as Literal ).Text = "<H1>Page for tab
" + count + "</H1>";
MultiPage1.Controls.Add( pv );
pv.ID = "page_" + count;
return pv;
}
</script>
<html>
<body>
<form runat="server">
<asp:button id="addBtn" runat="server" Text="+Tab"
OnClick="addTab" />
<iewc:tabstrip id="TabStrip1" runat="server"
targetid="MultiPage1" />
<iewc:multipage id="MultiPage1" runat="server" />
</form>
</body>
</html>
I posted this question without code, here is the code.
Again, the problem is: Viewstate of a pageviews child
controls is not saved as it would be if the control were
child of the page.
Any clues as to how to resolve this in the best way are
greatly appreciated. If one could make a control child of
multiple parents I could use Denis Bauers placeholder, but
afaik that is not possible.
Notice that this will probably not run using vanilla ie
webcontrols code, due to the bug I've posted about recently.
/mawi
Code (save as aspx file in a webroot, put
"Microsoft.Web.UI.WebControls.dll" - preferably bugfixed -
in "bin" directory of that root):
<%@ Page language="c#" AutoEventWireup="true" %>
<%@ Register TagPrefix="iewc"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<script runat="server">
void Page_Load()
{
for ( int i = 1; i <= TabStrip1.Items.Count; i++ )
NewPV( i.ToString() );
}
private void addTab(object sender, System.EventArgs e)
{
String count = (TabStrip1.Items.Count + 1).ToString();
Tab t = new Tab();
t.Text = t.ID = "Tab_" + count;
PageView pv = NewPV( count );
t.TargetID = pv.ID;
pv.Controls.Add( new Label() );
( pv.Controls[ 1 ] as Label ).Text = "Persist this!!";
TabStrip1.Items.Add( t );
}
private PageView NewPV( String count )
{
PageView pv = new PageView();
pv.Controls.Add( new Literal() );
( pv.Controls[ 0 ] as Literal ).Text = "<H1>Page for tab
" + count + "</H1>";
MultiPage1.Controls.Add( pv );
pv.ID = "page_" + count;
return pv;
}
</script>
<html>
<body>
<form runat="server">
<asp:button id="addBtn" runat="server" Text="+Tab"
OnClick="addTab" />
<iewc:tabstrip id="TabStrip1" runat="server"
targetid="MultiPage1" />
<iewc:multipage id="MultiPage1" runat="server" />
</form>
</body>
</html>