First, you’ll need to write a public method (property) in a master page:
public partial class MyMasterPage : System.Web.UI.MasterPage
{
public Button GetMyButton() { return Button1; }
}
Second, you’ll need to assign an event handler manually in a child page:
public partial class ChildPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
(Master as MyMasterPage).GetMyButton().Click += new
EventHandler(ChildPage_Click);
}
}
Alexey Borzenkov
"gencode" wrote:
I have a logout link in a master page...when the link is pressed I want
to capture that event in the child page, not the master page, becase
there is some processing I want to do in the child page...is there an
easy way to capture the "Handles LinkButtonLogout.Click" from the
child page?
Thanks, Ed,