Last post Jul 11, 2010 08:20 AM by Velojet
Jul 09, 2010 12:57 AM|Velojet|LINK
When I set up a new site in WebMatrix, the default/home page is default.cshtml. How do I change this to
(In 'Settings' for the site, there's a 'Manage Default Pages' option, but default.cshtml is not listed, and promoting index.html to the head of the list doesn't produce the change I need.)
Jul 09, 2010 08:30 AM|Vimpyboy|LINK
If you have a default.cshtml that is always the default start page, even if it´s not listed in the list with default pages under Settings. I guess it´s because how the routing works in ASP.NET Web Pages.
If you want a default.html as start page, you need to add it to the list with default pages, and remove the default.cshtml if you have that.
Jul 09, 2010 09:12 AM|Velojet|LINK
Brilliant! Thanks so much, Mikael, for your prompt and helpful reply. That's exactly what I needed to do - simply remove default.cshtml, then the Default Pages priority list in Settings is activated, as expected.
Jul 11, 2010 05:34 AM|TheSavior|LINK
From what I understand, both Default.cshtml and Index.cshtml (obviously .vbhtml too) are considered default landing pages. Since you don't need to specify an extension in the url to have the asp router grab the correct files, you can just make an Index.cshtml
file and navigate to http://mysite.com/Index
Jul 11, 2010 08:20 AM|Velojet|LINK
Thanks for your interest, TheSavior.
I need to give a bit more background to my original question.
The site in question is a legacy IIS site with a number of ASP (pre .NET) pages, including the homepage - which is actually index.asp (rather than index.html). I now want to use WebMatrix/IISExpress to maintain a local copy of that site - which means that
I want the ASP router not to hunt for any .cshtml/.vbhtml homepage but instead immediately load the (legacy) index.asp.