I'm having a master page in my website and having some control on master page.
I want to handle the master page controls event on content page.
how can i do that …?
even i have used property like this for a dropdown control
public DropDownList propertymastercontrol
{
get
{
return cmbVendor; //drop down id
}
}
and given the reference of master page on content page like this…
<%@ MasterType VirtualPath ="~/MasterPage.master" %>
still after not able to get the any event of control on content page_load event..
protected void Page_Load(object sender, EventArgs e)
{
Master.
}
what can be the problem..?
Best Answer
I'm not sure about C#, but in VB.NET I've done it with these four steps:
<%@ MasterType VirtualPath="~/master.Master" %>
UPDATE:
From your sample code, I can see you're not raising an event in the MasterPage (which you can respond to the content page). I was going to give an example, but it would be almost identical to this post, Pass MasterPage ImageButton event to content Page, which another SO user already has linked to in the answers here too.