Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,
I am placing Buttons (Save, Update, Delete, Clear) in Masterpage and I have 5 different content pages with the same masterpage. For each content page, actions/events are different (eg:save/update to different tables, Delete from table and clear the particular content page details). How we can achieve this?

Can anybody plz help me on this?
Posted

1 solution

Do not specify any button click handler in the master page, instead specify one for each content page.
You may try - In page_load for each content page:

C#
Button btn = this.Master.FindControl("Button1") as Button; //specify your button id   
btn.Click += new System.EventHandler(myBtnClickHandler);

Hope you got the idea.

[by pushp_aspnet]

Cheers,
Edo
 
Share this answer
 
Comments
ali_heidari_ 12-Feb-13 3:56am    
good idea !
Joezer BH 12-Feb-13 4:00am    
Tnx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900