Mar 02, 2009, 6:37 PM
UpdatePanel
Hello,
The following example demonstrates there is a complication with the UpdatePanel:
Example.aspx:
1. Load page
2. Switch to Tab 2
Notice the JavaScript error. Please keep me updated, if you need any further information feel free to contact me.
Cheers,
Timothy
The following example demonstrates there is a complication with the UpdatePanel:
Example.aspx:
<%@ Page Language="C#" %>
<%@ Register TagName="Example" TagPrefix="UserControl" Src="~/Example/Example-Contorl.ascx" %>
<%@ 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">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" EnablePartialRendering="true" />
<ext:ScriptManager runat="server" />
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ext:TabPanel ID="TabPanel1"
runat="server"
AutoPostBack="true"
DeferredRender="true">
<Tabs>
<ext:Tab ID="Tab1" runat="server" Title="Tab 1">
<Body>
Tab 1
</Body>
</ext:Tab>
<ext:Tab ID="Tab2" runat="server" Title="Tab 2">
<Body>
<UserControl:Example runat="server" />
</Body>
</ext:Tab>
</Tabs>
</ext:TabPanel>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Example-Control.ascx:<%@ Control Language="C#" ClassName="Example_Contorl" %>
<script runat="server">
protected void Store1_RefreshData(object sender, StoreRefreshDataEventArgs e)
{
Store1.DataSource = new object[] {
new object[] { 1, "Timothy" },
new object[] { 2, "Geoffrey" },
new object[] { 3, "Vladsch" }
};
Store1.DataBind();
}
</script>
<ext:Store ID="Store1"
runat="server"
AutoLoad="true"
OnRefreshData="Store1_RefreshData">
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="Customer" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="GridPanel1"
runat="server"
StoreID="Store1"
AutoExpandColumn="Customer"
AutoHeight="true"
AutoWidth="true">
<ColumnModel>
<Columns>
<ext:Column ColumnID="Customer" DataIndex="Customer" Header="Customer" />
</Columns>
</ColumnModel>
</ext:GridPanel>
Replication steps:1. Load page
2. Switch to Tab 2
Notice the JavaScript error. Please keep me updated, if you need any further information feel free to contact me.
Cheers,
Timothy