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


Manas MohapatraRank #182 · 13.2K reputationPosted Oct 28, 2016, 4:42 AM EDT
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");
}
}
Abolfazl155 reputationPosted Oct 28, 2016, 8:12 AM EDT
but in doesn't work for me.
Manas MohapatraRank #182 · 13.2K reputationPosted Oct 28, 2016, 8:16 AM EDT
Abolfazl155 reputationPosted Oct 28, 2016, 10:30 AM EDT