There's more than question and article about the same exact question but I have a couple more related questions and was hoping to get some answers.
I've heard of two approaches to find the button and add the handler or use an interface (Check both approaches from here) .. Which one do you suggest ?
If you could please illustrate the 'Interface' option with some code and where to class the interface file cause it's not readable in the page when I try to inherit it!
See From My Openion it will be best if you make use of event handlers...and even with the custom delegate..
like this
going through this manner give some flexibility like in case if in future you want to pass some data tour content page when clicked..its easily possible.
Second aproach is IMO better. The first choice couples a page to the specific master page, and it is not nice.
All files are placed in the same folder.
IPageInterface.cs:
Default.aspx.cs:
Site.Master.cs:
There are other approaches. E.g. you can publish an event via event broker.