Skip to content

Instantly share code, notes, and snippets.

@stevehorn
Created July 27, 2010 18:10
Show Gist options
  • Save stevehorn/492605 to your computer and use it in GitHub Desktop.
Save stevehorn/492605 to your computer and use it in GitHub Desktop.
//PassParametersDuringRedirectAttribute.cs
// ~Line 25
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
//Fair to say you'd only want this behavior on a GET request?
//I did this because it was hijacking properties on my model that was populated by a model binder.
if(filterContext.RequestContext.HttpContext.Request.HttpMethod == "GET")
{
LoadParameterValuesFromTempData(filterContext);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment