laptop and a wrench

Bug

Session state in SQL Server causes the switch of visibility of map resource item to fail.

Zuletzt veröffentlicht: August 25, 2014 No Product Found
Bug-ID-Nummer NIM008710
EingereichtMay 8, 2007
Zuletzt geändertJune 5, 2024
Gilt fürNo Product Found
Gefunden in Version9.2
StatusWill Not Be Addressed

Zusätzliche Informationen

No Public Explanation

Workaround

Objects stored in session state must be serializable if the mode is SQL Server. It's not very clear if ESRI web controls save unserializeable objects into session variables.Two workarounds were sent to the user.1. Remove all resource items and only add that single map resource item that should be visible.2. Turn off all layers inside those map resource items that should be invisible. Only layers in one resource item is set visible.Here is the code snippet for workaround 2: private void SetLayersVisibility(int resource_index, bool visibleSetting) { ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality mf = (ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality)Map1.GetFunctionality(resource_index); ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality ags_mf = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)mf; //ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase ags_mr = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceBase)qfunc.Resource; ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdescription; mapdescription = ags_mf.MapDescription; ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription[] layerdescs = mapdescription.LayerDescriptions; for (int layer_index = 0; layer_index < layerdescs.Length; layer_index++) { ESRI.ArcGIS.ADF.ArcGISServer.LayerDescription featureLayer = layerdescs[layer_index]; featureLayer.Visible = visibleSetting; } } private string SwitchMapService(string serviceName) { for (int resource_index = 0; resource_index < MapResourceManager1.ResourceItems.Count; resource_index++) { if (MapResourceManager1.ResourceItems[resource_index].Name != serviceName) { SetLayersVisibility(resource_index, false); } else { SetLayersVisibility(resource_index, true); } } Map1.Refresh(); Toc1.Refresh(); Map1.CallbackResults.AddRange(Toc1.CallbackResults); string mapcallbackresults = Map1.CallbackResults.ToString(); return mapcallbackresults; }

Schritte zur Reproduzierung

Bug-ID: NIM008710

Software:

  • No Product Found

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln