Hey,

I have created a multiple page website in ASP.NET/C# with a Master Page acting as template. The Master Page contains the navigation buttons and their appropriate links. On clicking a particular navigation button from a particular page, I would like the data on that page to be saved. The most logical way of doing this seems to me to be to create an overrideable method in the Master Page called OnPageSubmission() which is called every time a link is clicked. The page in question would then override this method and save the data on it's page to the database. Is this possible and how do I go about programming this in the Master Page?

My navigation buttons are set in the ASP.NET side of the Master Page and are called imgbtnAzubi, imgbtnBeur and so forth...

Code:
// On clicking img btn Azubi transfer to page Azubi
        protected void ImgbtnAzubi_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                // Save the page state
                //OnPageSubmission();

                // Transfer page
                Response.Redirect("TraineeSelection.aspx", true);
            }
            catch(HttpException)
            {
                Azubiportal.ErrorPage.SetError("404");
                errorPage.DisplayErrorMsg();
            }
        }

        // On clicking Beurteilung transfer to that page
        protected void ImgbtnBeurt_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                // ONLY if the current page is complete can progress!
                if (completedPageAzubi == true)
                {
                    Response.Redirect("ReportSelection.aspx", true);
                }
                else
                {
                    MessageBox("Bitte Wählen Sie einen Azubildender zur Bewertung aus.");
                }
            }
            catch (HttpException)
            {
                Azubiportal.ErrorPage.SetError("404");
                errorPage.DisplayErrorMsg();
            }
        }

(...)
The page in question could then have a method called OnPageSubmission()
Code:
protected override void OnPageSubmission()
{
       // Calls a method which sets the page's data
       SaveData();
}