What would be the best way to call a method in the code-behind of parent page from the code behind of the child page in the ASP.NET 2.0 Web Site model?
Scenario: User clicks a link in the parent page to view a data record's detail in child page (The parent and child are tow seperate pages). The user will modified the data in the client page. Once the child page has processed the update, the child page will close and I need to rebind the parent page to reflect the update.
I did something similar, but it was calling the parent page from a user control that was included in the parent page
if(Page.GetType().ToString().Contains("ASP.Default_aspx"))
{
MethodInfo MyMethod = this.Parent.TemplateControl.GetType().GetMethod("MyMethod");
MyMethod.Invoke(this.Page, null);
MyMethod = null;
}
UPDATE: I have to do this from the code behind because the child page closes after the data has been updated.