views:

406

answers:

1

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

A: 

Fixed after a chat with Jeremy Skinner.

http://github.com/mvccontrib/MvcContrib/commit/135411386b6817def9aaa493493ff582788ba377

redsquare
Where can I download the latest MvcContrib dlls?
Сергій
Can you give me working dll's please? [email protected]
Сергій
get the latest git and build it
redsquare
I just didn't want to sort git out. I thought there is shared build of last version.
Сергій