I have created a project ASP .NET 5 MVC 6. In that I want to change default routing. So in StartUp.cs file I have changed the controller and action name. But it is redirecting to old route instead new one. Below is code for old and new default routes.
Old default route
public void Configure(IApplicationBuilder app) {
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
New (change is only of controller and action name) route
public void Configure(IApplicationBuilder app) {
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller}/{action}/{id?}",
defaults: new { controller = "Login", action = "Login" });
});
}
Help to solve this issue. I want to redirect to my another controller-action method. Project is of ASP .NET 5 MVC 6 and login controller is of 'MVC controller class' type.
Thank You.