Abolfazl

Abolfazl

  • 1.2k
  • 184
  • 79k

How to redirect to a action method when a file not found

Oct 28 2016 7:13 AM
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 
 

Answers (4)