How to use ext:Window to open new aspx page?

  1. #1

    How to use ext:Window to open new aspx page?

    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.

  2. #2

    RE: How to use ext:Window to open new aspx page?

    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
  3. #3

    RE: How to use ext:Window to open new aspx page?

    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
  4. #4

    RE: How to use ext:Window to open new aspx page?

    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.
  5. #5
    Quote Originally Posted by agha View Post
    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 * * * * **
  6. #6
    If you use v2 then need to use Loader property
    Vladimir Shcheglov
    Sr. Developer
  7. #7

    I use the Loader but stiill it raise an Error

    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 .......????????
  8. #8
    You have to provide Loader instance
    win.Loader.Url = new ComponentLoader();
    Vladimir Shcheglov
    Sr. Developer
  9. #9

    ThanX for Repling....

    Its Work .. Thank you very much......

Similar Threads

  1. [CLOSED] Problems showing an aspx page within a window
    By digitek in forum 1.x Premium Help
    Replies: 6
    Last Post: Oct 22, 2012, 2:07 PM
  2. Replies: 7
    Last Post: Jul 31, 2012, 9:31 PM
  3. Open other aspx pages in desktop window
    By Vaishali in forum 1.x Help
    Replies: 1
    Last Post: Jan 19, 2012, 1:20 PM
  4. [CLOSED] Window inside an aspx page that is loaded in a TAB
    By Hari_CSC in forum 1.x Premium Help
    Replies: 1
    Last Post: May 06, 2010, 9:34 AM
  5. Window autoload an aspx page
    By gastonregistra in forum 1.x Help
    Replies: 2
    Last Post: Apr 24, 2008, 2:48 PM

Posting Permissions