I am developing a SharePoint 2010 Project totaly in Visual Studio and C#.

I do not want to use SharePoint Designer and configuration via browser.

I need to set a LAYOUT page (application page) as home page on multiples sites.

Is it possible?

If not, which is the best aproach?

Important: I need to solve this situation only with c# no configuration


3 Answers 3


You cannot set Application pages as Welcome Page, only Site pages located either at the root web or from a Pages library.

But you can use a Redirect Page or redirection from your home page to layouts page.

Please refer to Possible to have the default landing page of my Sharepoint Site be an applicaiton page?

How to Set an Application Page as a default landing page in SharePoint 2013 web site

  • Thanks Arsalan. Your second link use 2013. Is it possible in 2010? And I need to do that all by code (no configuration). Can I set a redirection in c#? Apr 12, 2016 at 11:09
  • 1
    Yes I think the page layout is available in 2010 as well. And yes you can use C# either embed a custom web part in a default page that redirects to your application page. Apr 12, 2016 at 11:10
  • Do you have and example to set redirection using c#? Apr 12, 2016 at 11:12
  • 1
    Response.Redirect(SPContext.Current.Web.Url + "/_layouts/FolderName/ApplicationPage.aspx") Apr 12, 2016 at 11:13
  • I am sorry. That's not my question. In the link you mentioned it is shown how to configure redirection on a page and then set it as your home page. All that I need to do using c # code as it applies to many sites. Apr 12, 2016 at 11:16

You can create a delegate control that would check if the current page is welcome page of the site. If Yes, then it would redirect to your application page using


Response.Redirect(SPContext.Current.Web.Url + "/_layouts/YourApplicationPage.aspx");


window.location.href = _spPageContextInfo.webAbsoluteUrl + "/_layouts/YourApplicationPage.aspx";

Otherwise there is no direct way of setting an application page as welcome page.

  • What bad news! So you're saying that there is no possibility to solve this problem without redirection? Apr 12, 2016 at 12:20

Inspired by Arsalan Adam Khatri's answer I found a solution:

1) First create a page to handle the redirection:


<META http-equiv="refresh" content="0;URL=./_layouts/folder/HomePageCustom.aspx">

2) Then create a module to deploy this file

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="ModuleLayoutPageRedirect">
    <File Path="ModuleLayoutPageRedirect\LayoutPageRedirect.aspx" Url="LayoutPageRedirect.aspx" />

3) Then change the welcome page

SPFolder rootFolder = currentWeb.RootFolder;
string home = "LayoutPageRedirect.aspx";
rootFolder.WelcomePage = home;

4) Finally Test

Enter http://server/site/web

Automatically goes to:


And redirected to:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.