ASP.NET MVC ,Maintaining Model State between Ajax requests
Posted
by Podders
on Stack Overflow
See other posts from Stack Overflow
or by Podders
Published on 2010-03-08T11:42:14Z
Indexed on
2010/03/08
12:06 UTC
Read the original article
Hit count: 412
problem: On first full page request, my controller invokes an applicationServices Layer (Web Service Proxy to my business tier) in order to populate a collection of current services that is stored in my own controller base class property. This is then to be displayed within a view. Everything within the context of that controller has access to this "Services Collection". Now when i make further calls to the same action method via an AJAX Call, i obviously hitt a different instance of that controller meaning my services collection is empty.
So other than re-getting the whole collection again, where would i store this collection so it gets persisted between ajax requests? Should i persist it as a seperate DomainModel Object, Session object?....as ViewData is not working for me obv. Excuse my MVC ignorance :)
Any help would be greatly appreciated :)
© Stack Overflow or respective owner