PDA

View Full Version : [CLOSED] Loading External Page in Ext.Window is not working



Tarun_Chand
Apr 03, 2013, 11:09 AM
Hi Ext.Net Team,

I have a requirement to load the another asp page from ext.net page as child page (like javascript - showmodaldialog). i have tried with the following code but its not working. its opening a blank window.

ASPX Page:


<ext:Button ID="btnMainMenu" runat="server" Text="Main Menu" OnDirectClick="btnMainMenu_Click"
StandOut="true">
</ext:Button>
<ext:Window ID="windowOptimization" Hidden="true" runat="server" Collapsible="true"
Icon="Application" Title="Optimization Criteria" AutoRender="false" Maximizable="true"
Minimizable="false" MinHeight="550" MinWidth="800">
</ext:Window>

Code Behind Page (Inside Main Menu click event):


ComponentLoader loader = new ComponentLoader();
loader.Url = "mainmenu.asp";
loader.Mode = LoadMode.Frame;
loader.LoadMask.ShowMask = true;
this.windowOptimization.Loader = loader;
this.windowOptimization.Show();

when execute the above code and clicking on "Main Menu" button, the window is opening but blank. i have tried replacing Url to http://www.ext.net but still its showing blank window.

Kindly do the needful.

Daniil
Apr 03, 2013, 1:50 PM
Hello Tarun,

Please define a Loader for the Window and call its LoadContent method.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Load(object sender, DirectEventArgs e)
{
this.Window1.LoadContent("http://ext.net");
this.Window1.Show();
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Window
ID="Window1"
runat="server"
Hidden="true"
Height="500"
Width="500">
<Loader Mode="Frame" AutoLoad="false">
<LoadMask ShowMask="true" />
</Loader>
</ext:Window>

<ext:Button
runat="server"
Text="Load"
OnDirectClick="Load" />
</form>
</body>
</html>

Tarun_Chand
Apr 03, 2013, 2:33 PM
It is perfectly working. Many Thanks Daniil.



Hello Tarun,

Please define a Loader for the Window and call its LoadContent method.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Load(object sender, DirectEventArgs e)
{
this.Window1.LoadContent("http://ext.net");
this.Window1.Show();
}
</script>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Window
ID="Window1"
runat="server"
Hidden="true"
Height="500"
Width="500">
<Loader Mode="Frame" AutoLoad="false">
<LoadMask ShowMask="true" />
</Loader>
</ext:Window>

<ext:Button
runat="server"
Text="Load"
OnDirectClick="Load" />
</form>
</body>
</html>

Tarun_Chand
Apr 04, 2013, 6:51 AM
Hi Daniil,

Now i am facing a different issue. Now i am able to open a asp page in the ext window successfully. In my asp page, i have the following code written for accessing the parent form.


opener.document.form1.action= "SendToOptimization.asp?RQ=" + ReqId + "&Sel=" + Sel + "&Cri=" + strOptimCriteria + "&Queue=Ins";
opener.document.form1.method= "post";
opener.document.form1.submit();

In the above code, the object "opener.document" is throwing "null object" exception.

Please let me know how i achieve this.

Daniil
Apr 04, 2013, 10:28 AM
Probably, you should replace "opener" with "parent". Does it help?

Tarun_Chand
Apr 04, 2013, 1:06 PM
Yes, it worked. Many Thanks Daniil.