Monday, 15 August 2011

asp.net mvc - How to store ViewData in TempData when not using Sessions? -



asp.net mvc - How to store ViewData in TempData when not using Sessions? -

i learned tempdata mvc backed sessions default, terrible thought if 1 ever intends have web farm...

i attempted implement brock allen's cookie based tempdata provider, however, viewdata object not marked seriablizable, , such, cannot stored in cookie based provider (or session state service, etc etc...)

type 'system.web.mvc.viewdatadictionary' in assembly 'system.web.mvc, version=5.1.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' not marked serializable. brockallen.cookietempdata.cookietempdataprovider.savetempdata(controllercontext controllercontext, idictionary`2 values) in c:\ballen\github\cookietempdata\45\brockallen.cookietempdata\cookietempdataprovider.cs:31 system.web.mvc.tempdatadictionary.save(controllercontext controllercontext, itempdataprovider tempdataprovider) +154

how around this?!

update:

perhaps batter way inquire be: how send viewdata controller method (prg: post, redirect, paradigm) without needing tempdata (and hence sessions)?

asp.net-mvc session tempdata

No comments:

Post a Comment