Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Validate ContentTabItem selected from the codebehind of a Webtab v11.2
posted

Hello...

As active a method or event in c # when clicking on one of the selected tab of a Webtab v11.2 and later display several different controls or usercontrols in each ContentTabItem.

Similarly us and if there is another way to validate the contents of a ContentTabItem by text or key.

This is my code

Markup

<ig:WebTab ID="WebTab1" runat="server" Height="700px" Width="700px">
<Tabs>
<ig:ContentTabItem runat="server" Key="tab1" Text="Tab 1">
</ig:ContentTabItem>
<ig:ContentTabItem runat="server" Key="tab2" Text="Tab 2">
</ig:ContentTabItem>
<ig:ContentTabItem runat="server" Key="tab3" Text="Tab 2">
</ig:ContentTabItem>
</Tabs>
</ig:WebTab>

And here not add me to all controls ContentTabItem

Codebehind

System.Web.UI.WebControls.Label l1 = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.TextBox t1 = new System.Web.UI.WebControls.TextBox();
System.Web.UI.WebControls.DropDownList d1 = new System.Web.UI.WebControls.DropDownList();

foreach (ContentTabItem tab in web3.Tabs)
{

switch (tab.Text)
{
case "Tab 1":
tab.Controls.Add(t1);
tab.Controls.Add(d1);
tab.Controls.Add(l1);
break;
case "Tab 2":
tab.Controls.Add(d1);
break;
case "Tab 3":
tab.Controls.Add(t1);
break;

}
}

In advance thank you very much