1
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 }
        );

    }

}

I don't know why it has opened http://localhost:00000/Views/Dashboard/Index.cshtml in this location

What can do that?

DMac the Destroyer
  • 5,240
  • 6
  • 36
  • 56
Yitzhak Weinberg
  • 2,324
  • 1
  • 17
  • 21

2 Answers2

3

Try this

1) Right click on your project solution

2) Select Property

3) Select Web option and then Select Current Page

Manish Kumar
  • 509
  • 5
  • 15
0

Hello use this code.

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 },
                namespaces: new[] { "YourProjectDLLName.Controllers" }
            );
        }

Make Sure don't forget to add namespace of your project DLL. after do this build your project and debug.