Custom Feature and masterpagesHI. <br/>I've developed a feature (deployed with scope Web ) which has custom pages too. <br/>I had deployed it to a server which has multiple site collections<br/>each site collection will have its own look and feel + different masterpages.<br/>My biggest problem is that I need my feature pages to have the same look and feel as  site were it is deployed.<br/>is there any SPTag that I can use to load masterpages specified for the site? or I have to do it programmaticaly?<hr class="sig">--© 2009 Microsoft Corporation. All rights reserved.Mon, 06 Jul 2009 11:21:59 Zf64969e4-01b9-4ff8-b29b-92ccab720ff9http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#f64969e4-01b9-4ff8-b29b-92ccab720ff9http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#f64969e4-01b9-4ff8-b29b-92ccab720ff9zdragonhttp://social.msdn.microsoft.com/Profile/en-US/?user=zdragonCustom Feature and masterpagesHI. <br/>I've developed a feature (deployed with scope Web ) which has custom pages too. <br/>I had deployed it to a server which has multiple site collections<br/>each site collection will have its own look and feel + different masterpages.<br/>My biggest problem is that I need my feature pages to have the same look and feel as  site were it is deployed.<br/>is there any SPTag that I can use to load masterpages specified for the site? or I have to do it programmaticaly?<hr class="sig">--Sat, 04 Jul 2009 08:30:48 Z2009-07-04T08:30:48Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#412becee-8118-485d-8fed-915019fe644dhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#412becee-8118-485d-8fed-915019fe644dSébastien Sougnezhttp://social.msdn.microsoft.com/Profile/en-US/?user=S%u00e9bastien%20SougnezCustom Feature and masterpagesHello,<br/> <br/> Maybe I didn't understand your probleme, but normally, in your ASPX page, you have something like this :<br/> <br/> <div class="code_C"> <pre lang=x-aspx>&lt;%@ Page Language=&quot;C#&quot; Inherits=&quot;PageApp1.PageApp1&quot; MasterPageFile=&quot;~/_layouts/application.master&quot; EnableViewState=&quot;false&quot; EnableViewStateMac=&quot;false&quot; %&gt; </pre> <br/> So you juste have to change the MasterpageFile attribute, haven't you ?<br/> <span class=bleu></span></div> <br/> <br/><hr class="sig">http://www.areaprog.comSat, 04 Jul 2009 16:16:25 Z2009-07-04T16:16:25Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#d9671ea1-bc45-4138-b5e6-d43db8762ef9http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#d9671ea1-bc45-4138-b5e6-d43db8762ef9zdragonhttp://social.msdn.microsoft.com/Profile/en-US/?user=zdragonCustom Feature and masterpages<pre>MasterPageFile=&quot;~/_layouts/application.master&quot; </pre> <p>replacig this bit will work only for 1 individual site collection.</p> <p>the feature have to be enabled in other site collections too and those othere sites wil have their own masterpage..</p> <p>ex. Site Coll 1. will have SiteOne.master</p> <p>Collection 2: SiteTwo.master.</p> <p>The problem now is that my feature aspx pages have to pick up one of those master pages. depending in what site collection is loaded.</p> <p> </p><hr class="sig">--Sun, 05 Jul 2009 09:10:12 Z2009-07-05T09:10:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#abdb5746-daed-47c6-86d4-c52cb7cc55e1http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#abdb5746-daed-47c6-86d4-c52cb7cc55e1Sébastien Sougnezhttp://social.msdn.microsoft.com/Profile/en-US/?user=S%u00e9bastien%20SougnezCustom Feature and masterpagesHello,<br/> <br/> have you a way to retrieve the name of the masterpage to attach to the page ? If yes, you can change the master page of the page in PreInit event :<br/> <br/> <pre class=libCScode style="white-space:pre-wrap">void Page_PreInit(Object sender, EventArgs e)<br/> <strong>{</strong> <br/> <strong> this.MasterPageFile = &quot;~/NewMaster.master&quot;;</strong> <br/> }<br/> </pre> <br/> I said that, but I don't know if your issue is to retrieve the name of the master page or to change the page dynamically :-)<hr class="sig">http://www.areaprog.comSun, 05 Jul 2009 09:39:57 Z2009-07-05T09:39:57Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#79f6ea2c-702c-4e52-8b5d-84aaf1369e1ehttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#79f6ea2c-702c-4e52-8b5d-84aaf1369e1ezdragonhttp://social.msdn.microsoft.com/Profile/en-US/?user=zdragonCustom Feature and masterpagesHi!<br/>I do consider this sollution too.<br/>there is an elegant way to do it with SPWeb.MAsterUrl property<br/> <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.masterurl.aspx">http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.masterurl.aspx</a><br/><br/>  is  there another way to do it? for example with an HTML tag ?<br/>ex, &lt;SPMasterPage .... /&gt;<br/><hr class="sig">--Sun, 05 Jul 2009 09:47:40 Z2009-07-05T09:47:40Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#241e5c9f-ea7a-4a17-ad3f-757b6d5a4b07http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#241e5c9f-ea7a-4a17-ad3f-757b6d5a4b07Sébastien Sougnezhttp://social.msdn.microsoft.com/Profile/en-US/?user=S%u00e9bastien%20SougnezCustom Feature and masterpagesHello,<br/> <br/> I don't think that you can. I searched on web and I found this link : http://www.odetocode.com/articles/450.aspx. Nothing in this article speaks about changing page dynamicaly by the ASPX code...<hr class="sig">http://www.areaprog.comSun, 05 Jul 2009 09:51:18 Z2009-07-05T09:51:18Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#c257bf3c-d34e-4a82-9608-473a49d248e0http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#c257bf3c-d34e-4a82-9608-473a49d248e0zdragonhttp://social.msdn.microsoft.com/Profile/en-US/?user=zdragonCustom Feature and masterpages<blockquote>Hello,<br/><br/>I don't think that you can. I searched on web and I found this link : http://www.odetocode.com/articles/450.aspx. Nothing in this article speaks about changing page dynamicaly by the ASPX code... <hr class=sig> http://www.areaprog.com</blockquote> <p><br/>in the link above it says : <span style="color:#cc0066"><em>The 'MasterPageFile' property can only be set in or before the 'Page_PreInit' event.</em> </span></p> <p><span style="color:#cc0066">so it is possible to do it .</span></p><hr class="sig">--Sun, 05 Jul 2009 10:26:04 Z2009-07-05T10:26:04Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#e0bd1da6-9517-4818-8715-5edc4d348371http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#e0bd1da6-9517-4818-8715-5edc4d348371Dave Hunterhttp://social.msdn.microsoft.com/Profile/en-US/?user=Dave%20HunterCustom Feature and masterpages<p>Hi,</p> <p>To make application pages (pages which exist in the _layouts directory) to use a different masterpage or to customise the application.master, you have two options<br/><br/>1. Modify the _layouts in a supported manner, please see <a href="http://support.microsoft.com/kb/944105"><span style="color:#0033cc">http://support.microsoft.com/kb/944105</span></a>.  It involves either backing up the _layouts and modifying the masterpage or creating a copy of the _layouts and changing the virtual directory to use the new folder (my preferred solution).<br/>2. Create a httpmodule which replaces the application.master with your custom one, please see <a href="http://graegert.com/?p=781"><span style="color:#0033cc">http://graegert.com/?p=781</span></a><br/><br/>I prefer the HttpModule, but I am a developer, if you don't have Visual Studio then use option 1.<br/><br/>Hope this helps<br/><br/>Dave </p><hr class="sig">My SharePoint Blog - <a href="http://www.davehunter.co.uk/blog">http://www.davehunter.co.uk/blog</a>Sun, 05 Jul 2009 15:33:05 Z2009-07-05T15:33:05Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#999b40f2-590c-4785-b8b5-39d46b35c686http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/f64969e4-01b9-4ff8-b29b-92ccab720ff9#999b40f2-590c-4785-b8b5-39d46b35c686kesav7902http://social.msdn.microsoft.com/Profile/en-US/?user=kesav7902Custom Feature and masterpageshello,<br/><br/>u can create a page using the publishing page object in the object model (creating the page dynamically in a publishing site)there by u can assigne the master page to it on the fly as a part of the feature reciever code --&gt; acheiveing the same look and feel across the site collection where ever u wish to have ....<br/><br/>cheers,<br/>keshav.Mon, 06 Jul 2009 11:21:59 Z2009-07-06T11:23:09Z