PDA

View Full Version : How to use ext:Window to open new aspx page?



jchau
Jul 24, 2008, 10:41 AM
On a button click in my main page, I want to pop open a new dialog
aspx page inside an ext:window. I set the Window's autoload property
but it seems like the dialog page is loaded when the main page is
loaded. Is there a way to load the aspx page inside the Window only
when the Window is shown? I would also like to add parameters to the
url of the dialog aspx page before it is shown.

agha
Jul 27, 2008, 4:42 AM
jchau,

If you want it to be done on the client side (i.e. using javascript), call the load function on the ext window, like:



Ext.get('windowId').load({
url: 'SomePage.aspx',
scripts: false // set this to true if there is any javascript
// on the target page that you would
// want to be executed
});


or if you want to do this through server side code, you have again the Load method of the ext:window control in which you'll have to pass in a LoadConfig object. e.g.:



protected void Button1_Click(object sender, EventArgs e)
{
Coolite.Ext.Web.LoadConfig config = new Coolite.Ext.Web.LoadConfig("SomePage.aspx");
config.Scripts = false;
this.Window1.Load(config);
}



Hope this helps.

--
Agha

pstorch
Jul 28, 2008, 11:40 AM
Hi guys,

I'm trying to use the code, everything seems to work ok, but I'm getting an extjs error parsing the window webpage html. I'm using the property Frame=true.

Error: unknown runtmie error




update : function(html, loadScripts, callback){


...


this.dom.innerHTML = html;

the html variable have the loaded webpage html.

any clues?

thanks,

pstorch

jchau
Aug 01, 2008, 11:32 AM
Has anyone been able to resolve this? This same error occurs with using the ExtJS framework directly (not Coolite controls).

I looked through all the samples of using AutoLoad in Ext:window and Ext:tabpanel. It seems they all point to a page that returns simple html without all the other crap that an aspx page throws in. That seems a little misleading that the samples claim you can use AutoLoad to load any page.

Ganeshpatil
Oct 22, 2012, 11:23 AM
jchau,

If you want it to be done on the client side (i.e. using javascript), call the load function on the ext window, like:



Ext.get('windowId').load({
url: 'SomePage.aspx',
scripts: false // set this to true if there is any javascript
// on the target page that you would
// want to be executed
});


or if you want to do this through server side code, you have again the Load method of the ext:window control in which you'll have to pass in a LoadConfig object. e.g.:



protected void Button1_Click(object sender, EventArgs e)
{
Coolite.Ext.Web.LoadConfig config = new Coolite.Ext.Web.LoadConfig("SomePage.aspx");
config.Scripts = false;
this.Window1.Load(config);
}



Hope this helps.

--
Agha
It is not working im not getting the AutoLoad property of window control please help *me * * * * **

Vladimir
Oct 22, 2012, 12:39 PM
If you use v2 then need to use Loader property

Ganeshpatil
Oct 22, 2012, 12:53 PM
protected void ShowWindow(object sender, DirectEventArgs e)
{
Window win = new Window();
win.ID = "window1";
win.Width = Unit.Pixel(500);
win.Height = Unit.Pixel(500);
win.Modal = true;
win.Loader.Url = "http://ext.net";
win.Loader.Mode = Ext.Net.LoadMode.Frame;
win.Render(this.Form);
}

i write the above code but it gives an error as Object reference not set to an instance of an object.........
Wat to do .......????????

Vladimir
Oct 22, 2012, 1:46 PM
You have to provide Loader instance


win.Loader.Url = new ComponentLoader();

Ganeshpatil
Oct 22, 2012, 1:55 PM
Its Work .. Thank you very much......