Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC3 start page

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?

like image 234
Kyeotic Avatar asked Jun 17 '11 17:06

Kyeotic


4 Answers

  1. Go to the project's Properties
  2. Go to the Web tab
  3. Select the Specific Page radio button
  4. Remove url in the Specific Page text box
  5. Save Properties Tab.
like image 179
vamsi Avatar answered Nov 13 '22 02:11

vamsi


Try setting the start page to /.

like image 9
Jamie Dixon Avatar answered Nov 13 '22 02:11

Jamie Dixon


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!

like image 2
Gregory A Beamer Avatar answered Nov 13 '22 01:11

Gregory A Beamer


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

like image 1
user1627016 Avatar answered Nov 13 '22 00:11

user1627016