I am working on a web app in Visual Studio 2010, its mvc3. I Was trying to figure out how to publish it, and through various instructions I tried setting View/Home/Index as the start page. This was a bad idea. Now nothing is working, even trying to view the site as I have been (debugging with F5) is not loading properly.
I don't know what the start page was before, or how to undo this. I am very new to web development, and a little lost right now. How do I get my start page back?
Try setting the start page to /
.
If you leave it alone after set up, it should be like so:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
My suggestion is leave it like that. How do you "get back"?
Simple: Open another instance of Visual Studio. Create a blank MVC3 project. Copy over the routing rules and add custom rules (if any) below. Copy over the web.config with any customizations you have made (if any).
Then, right click the project and select publish. If you publish to a local folder, you will have to set up IIS properly, but you can work through the kinks on your local IIS instance (assume you have installed it, as this is a developer machine?). Once you know the set up, you can move to the server and you should be fine.
That is about all of the time I have for this one right now. Good luck!
i know this is an old post... but whoever comes after this would find the piece of info helpful
if you want to change the start up page in MVC3 u can do so by just specifying like this
Specify Page: Account/Logon
No need to include the view name if you say Views/Account/LogOn it would return Resource not found error and if you include / it would say bad request.
I tried the above option and could change my start up page from the annoying index page to LogOn.cshtml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With