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>
<configuration>
<system.Web>
<pages master="otc.master" />
</system.Web>
</configuration>