asp.net mvc - Redirect to an action with parameter and model binder doesn't work -


here codes. when redirect response action, model binder doesn't work.

can me ?

public void onexception(exceptioncontext filtercontext) {   var action = filtercontext.routedata.values["action"];   var controller = filtercontext.routedata.values["controller"];   var values = filtercontext.routedata.values;   var exceptionmessage = filtercontext.exception.message;   var exception = filtercontext.exception;    filtercontext.exceptionhandled = true;   exceptioninfo exceptioninfo = new exceptioninfo();   exceptioninfo.actionname = action.tostring();   exceptioninfo.controllername = controller.tostring();   exceptioninfo.exceptionmessage = exceptionmessage;    filtercontext.httpcontext.response.redirecttoroute(new   {     action = "error",     controller = "home",     exceptioninfo = exceptioninfo   }); }  public actionresult error(exceptioninfo exceptioninfo) {   return view(exceptioninfo); } 

i recommend using controller.redirecttoaction instead. there lots of overloads of should enable re-route controller/action require, parameters pertinent.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -