My main.aspx
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:
Define a JavaScript method in Kart.aspx that calls the direct method ReloadKart
, lets name it ReloadGrid
function ReloadGrid()
{
App.direct.ReloadKart();
}
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;
}
In Kart.aspx assign call the SetReloadGridDelegate
window.parent.SetReloadGridDelegate(ReloadGrid);
Finally in b.aspx call the parent method
window.parent.CallKartReloadGrid();