Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using ArcGIS Server Local datasource. ArcGIS Web ADF MapResourceManager control maintains resources added once until session is abandoned. Why does it do so? Why not just use viewstate? Map control maintains it's state in session, too (and Toc).

The minor problem is that before adding a new MapResourceItem to MapResourceManager I have to check wether it's inside already (with normal controls I would just check for Page.IsPostBack). The major one - how am I exposed to clear map's and toc's state (other that read default values and set them, overwriting whatever it saved into it's state; extent for example). I tried to call RefreshServerObjects() on MapResourceLocal, call GetStateFromDataSourceObjects() on IMapFunctionality retrieved from Map control. The only way that works is HttpContext.Current.Session.Abandon() which is not a solution.

So how do you either turn off storing map state in session or how do you reset that state at any time?

EDIT:

Just found a way to clear just map's session state without abandoning whole session: map.StateManager.RemoveAllSessionState(false);

But the question is still up - why is it done this way?

share|improve this question

1 Answer 1

The best answer is viewstate has to keep moving back and forth with page posts, versus sessionstate lives on the server. This was the ESRI workflow for there AJAX framework.

share|improve this answer
    
I would say this is pretty bad reasoning. Developer can choose to keep viewstate on serverside, too. ASP.NET controls could keep their state in session but they don't - if developer wants to keep it in session, then he would do it himself. Well, at least if this was the case they should have given the ability to switch to viewstate. –  Loki Kriasus May 28 '11 at 4:08
    
Yes, but the controls have constraints on them that the user didn't have a lot of options with. We ended up going to SessionServer and letting the system handle it all; it was cleaner. Im not saying ViewState is totally bad; but when you are doing a lot of back and forth, relying on the page just keeps a lot going back and forth in my view. –  D.E.Wright May 28 '11 at 5:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.