我试图从用户控件调用父页面中的方法:
用户控制:
public delegate void CallParent();
public event CallParent BindData;
protected void LoadDataPageWise(int iCurrentPage)
{
iPageIndex1 = iCurrentPage - 1;
BindData(); // This should trigger method in parent page
DisplayPageNumber();
}
父页面:
如何在父页面的页面加载中附加该委托?
public void BindGridRecords()
{
grdPages.PageIndex = rptPager.iPageIndex1;
grdPages.DataBind();
Session["PageIndex"] = grdPages.PageIndex;
}