Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to specify a default master page using web.config
Posted

1 solution

I think this is what you are looking for http://odetocode.com/code/419.aspx[^]

Scroll to "Master Pages and Configuration":

"There are three ways to associate a web form with a master page. You can use the Master attribute in the @ Page directive, and you can write to the MasterPageFile property in the PreInit event or earlier. We’ve seen examples of both of these techniques. Any web form using the Master attribute of the @ Page directive or setting the MasterPageFile property programmatically will override the web.config settings.

We can also assign a default master page for all web forms in a site in our web.config file using the <pages> element. An example excerpt from web.config is shown below."</pages>

XML
<configuration>
  <system.Web>
    <pages master="otc.master" />
  </system.Web>
</configuration>
 
Share this answer
 
Comments
rajnish2patel 28-Jan-13 14:04pm    
Ok this is Fine THEN ONE BIG QUESTION how to exclude Login Page from it

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