Ext.Net,loading 2 child page ,and reach from one child to another

僤鯓⒐⒋嵵緔 提交于 2019-11-29 18:12:58

Now you have 3 pages, the parent lets call it Parent.aspx, and the children Kart.aspx, and b.aspx

And you want to load the grid in Kart.aspx based on an event in b.aspx

Since you load the grid by calling the direct method

    [DirectMethod]
    public void ReloadKart()
    {    
        this.strKart.DataSource = cari_bll.GetAll();
        this.strKart.DataBind();
    }

its boils down to calling this method inside Kart.aspx

To achieve this you need to do the following:

  1. Define a JavaScript method in Kart.aspx that calls the direct method ReloadKart, lets name it ReloadGrid

    function ReloadGrid()
    {
        App.direct.ReloadKart();
    }
    
  2. Define a delegate to this method in Parent.aspx, lets call it ReloadGridDelegate, a method to call that delegate CallKartReloadGrid, and a method to set it SetReloadGridDelegate

    var ReloadGridDelegate;
    function CallKartReloadGrid()
    {
        ReloadGridDelegate();
    }
    function SetReloadGridDelegate(delegate)
    {
        ReloadGridDelegate = delegate;
    }
    
  3. In Kart.aspx assign call the SetReloadGridDelegate

    window.parent.SetReloadGridDelegate(ReloadGrid);
    
  4. Finally in b.aspx call the parent method

    window.parent.CallKartReloadGrid();
    
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!