Friday, 15 January 2010

asp.net - Avoiding a big data redirect in MVC without using TempData -



asp.net - Avoiding a big data redirect in MVC without using TempData -

problem:

you have custom controller action, modifies big amount of info (around 5mb). you need pass info controller action, not allowed modify.

what's best way this?

a normal redirecttoaction result in huge info post.

tempdata can't used workaround cannot modify other controller read tempdata.

[httppost, actionname("import")] public actionresult importpost(int id) { var bigdata = getbigdata(id); bigdata = manipulatebigdataintoformatothercontrollerunderstands(bigdata); // todo: redirect other controller (which has httppost attribute), somehow?? }

nevermind, came reply right after posting:

var c = new namespace.controllers.othercontroller(); c.controllercontext = controllercontext; homecoming c.action(bigdata);

asp.net asp.net-mvc

No comments:

Post a Comment