Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai friends ,
I have created a new MVC2 Project and Set SetUpStartPage to logon page then, run in the page. It throw page not found issue. What will i do next ? How to avoid this error ? Pls help me.

Thanks for advance.
Posted

1 solution

Probably there's no matching controller or action for that page(View). First of all, why do you need to use Setstartuppage option here? Use defaults route.
Check the sample code from this article
Routing Basics in ASP.NET MVC[^]
C#
public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new 
            { 
                controller = "Home", 
                action = "Index", 
                id = UrlParameter.Optional
            }
        );
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900