how can i bind the events for control in master page in content page
I am having a master page where i am having a button and i need to bind the events for that buttons from content page how can i code. Can any one post the possible code
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
raghu vPosted Jun 30, 2011, 8:28 AM
if u need to bind the events for control in master page in the content page u can acheve this by following 3 stpes
1) first u need to map the master page source to content page
this can be done using following way by adding this tag to content page
<%@ MasterType VirtualPath="~/MasterPage.master" %>
2) in master page expose the controls as public for ex if u hve the btn1, btn2 ....... in master page then
from cs file of masterpage
in the page init of content page u can assign the event handlers to the exposed controls of the master page like below
refer the following link for more deteail
:http://www.codeproject.com/KB/aspnet/MasterContentInteraction.aspx