[CLOSED] Adding a New Tab to TabPanel
Hello
I am not able to add new tab to a tabpanel, Here is the simplied Code, please tell me what am i missing??
also, Can i add a new tab of type "ext:Window" autoLoad with a URL ??
Thanks
TabPanel.aspx
Code:
<%@ Page Title="" Language="VB" AutoEventWireup="false" CodeFile="TabPanel.aspx.vb" Inherits="TabPanel" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form runat="server" >
<ext:ResourceManager ID="ResourceManager1" runat="server" ScriptMode="Debug" />
<ext:TabPanel ID="myTabPanel" runat="server" Width="450">
<Items>
<ext:Panel ID="first" runat="server" Html="First Tab" Title="First" AutoHeight="true" Padding="6" />
<ext:Panel ID="Second" runat="server" Html="Second tab" Title="Second" AutoHeight="true" Padding="6"/>
</Items>
</ext:TabPanel>
<ext:Panel ID="newTab" runat="server" Title="RFC Details" AutoHeight="true" Hidden="true">
<Content>
This is the newly added tab
</Content>
</ext:Panel>
<ext:Button runat="server" ID="btnAddTab" Text="Add new Tab" StyleSpec="margin-left:10px;padding-top:50px;" >
<DirectEvents>
<Click OnEvent="AddTab" />
</DirectEvents>
</ext:Button>
</form>
</body>
</html>
TabPanel.aspx.vb
Code:
Imports Ext.Net
Partial Class TabPanel
Inherits System.Web.UI.Page
Protected Sub AddTab(ByVal sender As Object, ByVal e As DirectEventArgs)
'Add the window to the tab
Me.myTabPanel.Items.Add(Me.newTab)
Me.myTabPanel.SetActiveTab(2)
Me.myTabPanel.Reload()
End Sub
End Class