I'm having an issue with the following code:
And the code behind:Code:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CooliteTesting._Default" %> <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" 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 runat="server"> <title></title> </head> <body> <ext:ScriptManager ID="extScriptManager" runat="server" /> </body> </html>
Any ideas?Code:public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ViewPort viewPort = new ViewPort(); viewPort.ID = "mainViewPort"; RowLayout rowLayout = new RowLayout(); rowLayout.ID = "mainRowLayout"; LayoutRow row1 = new LayoutRow(); row1.RowHeight = 0.5M; TabPanel tabPanel = new TabPanel(); tabPanel.Title = "Tab Panel"; tabPanel.AjaxEvents.TabChange.Event += TabPanel_Change; Tab tab1 = new Tab(); tab1.Title = "Tab 1"; Tab tab2 = new Tab(); tab2.Title = "Tab 2"; Tab tab3 = new Tab(); tab3.Title = "Tab 3"; tabPanel.Tabs.Add(tab1); tabPanel.Tabs.Add(tab2); tabPanel.Tabs.Add(tab3); row1.Items.Add(tabPanel); LayoutRow row2 = new LayoutRow(); row2.RowHeight = 0.5M; Panel panel = new Panel(); panel.Title = "Panel"; row2.Items.Add(panel); rowLayout.Rows.Add(row1); rowLayout.Rows.Add(row2); viewPort.Items.Add(rowLayout); Page.Controls.Add(viewPort); } private void TabPanel_Change(object sender, AjaxEventArgs e) { TabPanel tabPanel = (TabPanel)sender; int activeTabIndex = tabPanel.ActiveTabIndex; // Always 0 } }


Reply With Quote
