How to redirect a page to home page?
if (p == -1)
return RedirectToAction("Index");
this opens webpage like http://abc.com/Index in url
i want just http://abc.com
How to redirect a page to home page?
if (p == -1)
return RedirectToAction("Index");
this opens webpage like http://abc.com/Index in url
i want just http://abc.com
You shoul have correct routing with default values in your Global.asax.cs file. For example
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
and after that
if (p == -1)
return RedirectToAction("Index", "Home");