mawster,
Thanks for posting the solution.
It will probably help those who try to initialize pageview components.
Can I put your code @
www.iewebcontrols.net?
Please register (of course it's free), and tell me if you agree.
I modified one or two things:
<%@ 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 PageView NewPV( String count )
{
PageView pv = new PageView();
pv.Controls.Add( new Literal() );
pv.Controls.Add( new Label() );
MultiPage1.Controls.Add( pv );
pv.ID = "page_" + count;
return pv;
}
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[ 1 ] as Label ).Text = "Persist this!!";
( pv.Controls[ 0 ] as Literal ).Text = "<H1>Page for tab " + count + "</H1>";
TabStrip1.Items.Add( t );
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<p>
<asp:button id="addBtn" onclick="addTab" runat="server" Text="Add new Tab/Pageview"></asp:button>
</p>
<p>
<iewc:tabstrip id="TabStrip1" runat="server" targetid="MultiPage1" SepDefaultStyle="background-color:#FFFFFF;border-color:#AAAAAA; border-width:1px;border-style:solid;border-top:none;border-left:none; border-right:none" TabDefaultStyle="color:#aaaaaa;background-color:#EEEEEE; border-color:#AAAAAA;border-width:1px;border-style:Solid; font-weight:bold;font-family:Verdana;font-size:11px;height:21; width:79;text-align:center;" TabHoverStyle="color:blue" TabSelectedStyle="color:#000000;background-color:#FFFFFF; border-bottom:none"></iewc:tabstrip>
<iewc:multipage id="MultiPage1" runat="server"></iewc:multipage>
</p>
</form>
</body>
</html>
DNN skins ForumTressleworks modulesDNN & webhostingIEWCtrls