Nov 13, 2012, 6:31 PM
How to close windows from a child iFrame button?
Hi All,
I create a window inside CategoryList.aspx and load CategoryAddPage.aspx inside the window.
Create a Window
Thanks,
Sang Nguyen
I create a window inside CategoryList.aspx and load CategoryAddPage.aspx inside the window.
Create a Window
static Window windowsaction;
protected void cmdCreateWindows_Click(object sender, DirectEventArgs e)
{
string url = "CategoryAddPage.aspx?parentid=" + parentid.ToString() + "&level=" + level.ToString();
windowsaction = null;
windowsaction = new Window
{
ID = "windowsaction",
Title = "Category Add",
Height = 500,
Width = 400,
Border = false,
Maximizable = true,
Minimizable = true,
IDMode = Ext.Net.IDMode.Explicit,
ClientIDMode = System.Web.UI.ClientIDMode.Static,
Collapsible = true,
Modal = true,
CloseAction = CloseAction.Destroy,
Loader = new ComponentLoader
{
Url = url,
Mode = LoadMode.Frame,
LoadMask =
{
ShowMask = true
}
}
};
windowsaction.Render(this.Form);
}
CategoryAddPage.aspx<%@ Page Title="" Language="C#" MasterPageFile="~/ithinkltd/pages/ExtMasterPage.master" AutoEventWireup="true" CodeFile="CategoryAddPage.aspx.cs" Inherits="ithinkltd_pages_CategoryAddPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
<Items>
<ext:FormPanel ID="FormPanel1" runat="server" ButtonAlign="Right" BodyCls="formpanelstyle">
<Items>
<ext:TextField ID="txtCategoryName" runat="server" AnchorHorizontal="100%" FieldLabel="Category Name" LabelAlign="Top">
</ext:TextField>
<ext:FileUploadField ID="txtCategoryImage" runat="server" AnchorHorizontal="100%" FieldLabel="Category Image" LabelAlign="Top">
</ext:FileUploadField>
<ext:TextField ID="txtSEOTitle" runat="server" AnchorHorizontal="100%" FieldLabel="SEO Title" LabelAlign="Top">
</ext:TextField>
<ext:TextField ID="txtSEOKeyword" runat="server" AnchorHorizontal="100%" FieldLabel="SEO Keyword" LabelAlign="Top">
</ext:TextField>
<ext:TextField ID="txtSEODescription" runat="server" AnchorHorizontal="100%" FieldLabel="SEO Description" LabelAlign="Top">
</ext:TextField>
</Items>
<Buttons>
<ext:Button ID="cmdSaveAndClode" runat="server" Icon="Disk" Text="Save & Close">
</ext:Button>
<ext:Button ID="cmdClose" runat="server" Icon="Cancel" Text="Close">
<DirectEvents>
<Click OnEvent="cmdClose_Click"></Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Items>
</ext:Viewport>
</asp:Content>
Close Button Eventprotected void cmdClose_Click(object sender, DirectEventArgs e)
{
// Close Parent Windows Here!
}
Is it possible to close windows from code behind?Thanks,
Sang Nguyen