We can apply a Master Page to every content page in a particular folder or every content page in an entire application. Rather than add a MasterPageFile attribute to individual content pages, we can add a configuration option to the web configuration file.
For example
The web configuration file given below applies the SimpleMaster.master Master Page to every page contained in the same folder (or subfolder) as the web configuration file.
<?xml version="1.0"?>
<configuration>
<system.web>
<pages masterPageFile="~/MasterPage.master" />
</system.web>
</configuration>
The Above Master Page
given in the Web.config file is applied only to content pages. If a page does
not contain any Content controls and it is a normal ASP.NET page then the Master
Page is ignored. We can override the Master Page configured in the web
configuration file in the case of a particular content page. In other words, a
MasterPageFile attribute in a content page takes precedence over a Master Page
specified in the web configuration file.
Note: This
is last part of this series of articles.

Yaduveer SainiPosted Oct 21, 2015, 7:48 AM
Good Job
Richa GargPosted Sep 20, 2012, 11:30 PM
Hi abhimanyu, If in my application I use more then one master page, and if I set one master page in web.config file, as your article explain so it will apply to all the web pages..so how can I use different master pages.Is their any concept so that I apply these all master pages in the wen.config file.