I have three pages: Default.aspx, AddOrEdit.aspx and List.aspx.
Default page
Default.aspx: I have a Window control
<script language="javascript">
var loadWindow = function (url, title, width, height) { Ext.net.DirectMethods.ShowWindow(url, title, width, height); }
</script>
<ext:Window ID="wdCommon" runat="server" Icon="ApplicationViewGallery" Title="ASP.NET Button with Custom DirectEvent" AutoScroll="true" BodyStyle="background-color:#fff;" Draggable="false" Resizable="false" Hidden="true" MaskDisabled="false"> <AutoLoad MaskMsg="Đang nạp dữ liệu..." ShowMask="true">
</AutoLoad>
<Listeners>
<BeforeShow Fn="fitWindow" />
</Listeners>
<Buttons>
<ext:Button ID="Button1" runat="server" Icon="ArrowUndo" Text="Đóng">
<Listeners>
<Click Handler="wdCommon.hide();" />
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>
Default.aspx.cs
[DirectMethod]
public void ShowWindow(string url, string title, int width, int height)
{ wdCommon.AutoLoad.Url = url;
wdCommon.Title = title;
wdCommon.Width = width;
wdCommon.Height = height;
//wdCommon.
wdCommon.AutoLoad.Mode = LoadMode.IFrame;
wdCommon.Render(this.Form);
wdCommon.Show(); }