laptop and a wrench

漏洞

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

上次发布: August 25, 2014 No Product Found
漏洞 ID 编号 NIM008710
已提交May 8, 2007
上次修改时间June 5, 2024
适用范围No Product Found
找到的版本9.2
状态Will Not Be Addressed

附加信息

No Public Explanation

解决办法

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; }

重现步骤

漏洞 ID: NIM008710

软件:

  • No Product Found

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项