By default does not redirect to controller index action method
I recently created a controller call DashboardVideos
and action method called Index
.
And after Add
Or Update
, I redirect it to the index page with
RedirectToAction("Index", "DashboardVideos")
...
but this code redirects it to /DashboardVideos/
and it says
HTTP Error 403.14 - Forbidden The web server is configured to not display the contents of this directory.
so the issue defaults to the page loading Index
when I say /Dashboard
But its not, the same url pattern works with all other controller (so I don't think there is anything wrong with the routing pattern).
Any help would be appreciated.
code:
public class DashboardVideosController : BaseController
{
private readonly IDashboardVideosComponent socialTagComponent;
public DashboardVideosController()
{
socialTagComponent = ComponentFactory.Get<IDashboardVideosComponent>();
}
// GET: DashboardVideos
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult AddUpdate(DashboardVideosModel socialTagChannel)
{
//Save data to database
return RedirectToAction("Index", "DashboardVideos");
}
}
source to share