i was reading a article on mvc for uncontrolled action http://www.codeproject.com/Articles/874284/ASP-NET-MVC-Performance-Tips?msg=5003414#xx5003414xx
they write this code for uncontrolled action
protected override void HandleUnknownAction(string actionName)
{
RedirectToAction("Index").ExecuteResult(this.ControllerContext);
}
author is saying that if a user request http://localhost:58234/default/index1, index1 action which does not exist so it will redirect to the default/index
i want to develop a base controller and put a routine which detect action method or controller exist or not for request url. if not exist then it will redirect user to a action method of a specific controller with query string value. as a result we can show a friendly message to user.
still i got no chance to work with mvc in office. just out of curiosity i like to know how to achieve the functionality with base controller?
help me with sample code. thanks