Accessing Master page functions from a content page

Accessing Master page functions from content page we must include a MasterType directive at the top of the Content page ASPX file:

<%@ MasterType virtualpath="~/DetailsMaster.master" %>

In DetailsMaster.master.cs page
public void SavePageData()
{
// function definition
}

After place the MasterType directive is in place in the Content page, then public functions in the Master page are available to the Content page code.

C# Code:
//Call the SavePageData function from the Master page
Master.SavePageData();

I hope it will helpfull for other developer.

Comments

Anonymous said…
I would like to exchange links with your site www.blogger.com
Is this possible?
Anonymous said…
I would like to exchange links with your site aspboss.blogspot.com
Is this possible?
Sajib said…
It's really a extra-ordinary site....its just fulfill the developers daily needs......

Popular posts from this blog

The model backing the 'MyDBContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet."

Check/Uncheck all items in a CheckBoxList using Javascript