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

前端 未结 1 555
面向向阳花
面向向阳花 2020-12-22 11:59

My main.aspx

    
    
<
相关标签:
1条回答
  • 2020-12-22 12:41

    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();
      
    0 讨论(0)
提交回复
热议问题