MVCContrib ActionFilter PassParametersDuringRedirect still passes reference type in querystring

Posted by redsquare on Stack Overflow See other posts from Stack Overflow or by redsquare
Published on 2010-01-06T17:46:45Z Indexed on 2010/04/04 20:03 UTC
Read the original article Hit count: 885

Filed under:
|

I am attempting to use the PRG pattern in an asp.net mvc 2 rc application.

I found that the MVCContrib project has a custom action filter that will auto persist the parameters in TempData

In an action I have the following

return this.RedirectToAction(c => c.Requested(accountAnalysis));

however this is adding a querystring param to the request e.g

http://mysite.com/account/add?model=MyProject.Models.AccountAnalysisViewModel

Can anyone explain how I can use the PassParametersDuringRedirect filter attribute from MVCContrib to not pass the ViewModel type in the querystring.

I see a patch was issued to fix this however in the latest MvcContrib that supports MVC 2 RC it is commented out as follows

public static RedirectToRouteResult RedirectToAction<T>(this Controller controller, Expression<Action<T>> action)
            where T : Controller
        {
            /*var body = action.Body as MethodCallExpression;
            AddParameterValuesFromExpressionToTempData(controller, body);
            var routeValues = Microsoft.Web.Mvc.Internal.ExpressionHelper.GetRouteValuesFromExpression(action);
            RemoveReferenceTypesFromRouteValues(routeValues);
            return new RedirectToRouteResult(routeValues);*/
            return new RedirectToRouteResult<T>(action);
        }

Any help much appreciated.

Thanks

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about mvccontrib