You can attach a master page dynamically to a content page. Because the master page and content page are merged during the initialization stage of page processing, a master page must be assigned before then. Typically, you assign a master page dynamically during the PreInit stage.
void Page_PreInit(Object sender, EventArgs e)
{
this.MasterPageFile = "~/MyMaster.master";
}
Please note this article on MSDN:
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx
Thanks,
-RG