how to apply custom master page to application pages

Great and working article about how to put custom master page within application page. In my case this was custom display form for content type…

Thanks a lot for share this peace of code!

Rana Omer Hussain's RegEdit

I came across a position, where i have an application page developed for user requirement and the user desires the look and feel of this page to me similar to other pages in the context.

I tried so many alternatives but didn’t get prospered; I found the right to use the default.master or custom master page for application pages.

First thing is that if you need to use a masterpage from the site context, you want to have the similar content placeholders as are expected by the master page.

Master pages can be loaded dynamically. This can be done by assigning a master page file to the MasterPageFile property in the Page object. This property may only be assigned in the Page PreInit event, this is the first event executed page execution lifecycle.

Copy and paste this below code in your custom application page and deploy the assembly to GAC…

View original post 73 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s