Hi
I have a action method in a controller and call a html file from this action method.
my controller name is Admin and my action method is ShowAdminDashboard.
when I request Admin/ShowAdminDashboard everything is ok, but when I call a html file from this method, for example login.html, the url changes to Admin/login.html and I face with 404 error page.
I understand it looks on ApplicationPath/Admin/login.html but can't find Admin folder and login.html.
I want to redirect to a specific method instead of showing 404 error page in this situation.in addition I want to redirect just for Admin controller.
I try overriding HandleUnknownAction for Admin controller but it doesn't work.
can you help me?
thanks

AbolfazlPosted Oct 28, 2016, 2:30 PM
Manas MohapatraPosted Oct 28, 2016, 12:16 PM
AbolfazlPosted Oct 28, 2016, 12:12 PM
but in doesn't work for me.
Manas MohapatraPosted Oct 28, 2016, 8:42 AM
You can implement following ways to achieve your functionality:
{
public ViewResult Index()
{
return View("Error");
}
public ViewResult NotFound()
{
Response.StatusCode = 404; //you may want to set this to 200
return View("NotFound");
}
}