HI

Issue : How to pass DataTable to child page from parent Page

I'm adding Child.aspx in the extPanel at runtime. but how to pass dataTable to the "Child.aspx" page .so that on the page_Load of child control i need to take the datatable and bind to grid .

Please Find the Pages ParentPages,aspx and ChilPage.aspx below

ParentPages.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ 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">

<script runat="server">

protected void Load(object sender, DirectEventArgs e)
{
if (!Page.IsPostBack)
{
System.Data.DataTable dts = GetTable();
string strUrl = "Child.aspx";
this.pnlSubYtd1.Hidden = false;
this.pnlSubYtd1.AutoScroll = true;
this.pnlSubYtd1.AutoLoad.Url = strUrl;
this.pnlSubYtd1.AutoLoad.Mode = LoadMode.IFrame;
this.pnlSubYtd1.AutoLoad.ShowMask = true;
this.pnlSubYtd1.AutoLoad.MaskMsg = "Loading.....";
this.pnlSubYtd1.AutoLoad.NoCache = true;
this.pnlSubYtd1.LoadContent();
}
}

/// <summary>
/// This example method generates a DataTable.
/// </summary>
public System.Data.DataTable GetTable()
{
//
// Here we create a DataTable with four columns.
//
System.Data.DataTable table = new System.Data.DataTable();
table.Columns.Add("Test", typeof(string));
table.Columns.Add("Comments", typeof(string));
table.Columns.Add("iconClsForCommand", typeof(string));
table.Columns.Add("iconClsForCommand1", typeof(string));

//
// Here we add five DataRows.
//
table.Rows.Add("25", "Indocin", "David", "Raj 1");
table.Rows.Add("50", "Enebrel", "Sam", "Raj 2");
table.Rows.Add("10", "Hydralazine", "Christoff", "Raj 3");
table.Rows.Add("21", "Combivent", "Janet", "Raj 4");
table.Rows.Add("100", "Dilantin", "Melanie", "Raj 5");
return table;
}


</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET Example</title>

<script type="text/javascript">

</script>

</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel ID="pnlSubYtd1" runat="server" Height="1000" Width="1220" Padding="5"
Border="false" Hidden="true">
<AutoLoad Url="" TriggerEvent="show" />
</ext:Panel>
</form>
</body>
</html>

ChildPage.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">

protected void Load(object sender, DirectEventArgs e)
{
if (!Page.IsPostBack)
{
//System.Data.DataTable dts = GetTable;
//How can i get DataTable which is passed from parent page
StoreMaterialCost.DataSource = "";
StoreMaterialCost.DataBind();
}
}
</script>

<!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>

<script type="text/javascript">

</script>

</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GrdMaterialCost" runat="server" EnableColumnMove="false" ButtonAlign="Center"
Height="140" Border="true" Width="1210" EnableColumnResize="false" AutoScroll="true"
Padding="0">
<Store>
<ext:Store ID="StoreMaterialCost" runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Test" Type="String" />
<ext:RecordField Name="Comments" Type="String" />
<ext:RecordField Name="iconClsForCommand" Type="String" />
<ext:RecordField Name="iconClsForCommand1" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column DataIndex="Test" Sortable="true" Header="Test" Width="75" Resizable="false"
MenuDisabled="true" Css="text-align:right;" Align="Left" />
<ext:Column DataIndex="Comments" Sortable="true" Header="Comments" Width="75" Resizable="false"
MenuDisabled="true" Css="text-align:right;" Align="Left" />
<ext:Column DataIndex="iconClsForCommand" Sortable="true" Header="iconClsForCommand" Width="75" Resizable="false"
MenuDisabled="true" Css="text-align:right;" Align="Left" />
<ext:Column DataIndex="iconClsForCommand1" Sortable="true" Header="iconClsForCommand1" Width="75" Resizable="false"
MenuDisabled="true" Css="text-align:right;" Align="Left" />
</Columns>
</ColumnModel>
</ext:GridPanel>
</form>
</body>
</html>

Regards
Praveen nampally