Edits to layerdefinitions are not being saved consistently for MapResourceItem.
Last Published: August 25, 2014ArcGIS Server (.NET)
Bug ID Number
NIM039011
Submitted
October 2, 2008
Last Modified
June 5, 2024
Applies to
ArcGIS Server (.NET)
Version found
9.3
Status
Will Not Be Addressed
The development team has considered the issue or request and concluded it will not be addressed. The issue's Additional Information section may contain further explanation.
Additional Information
No Public Explanation
Workaround
Copy and paste the following code snippet in the Page_Load part. Remove everything in the LayerDefinitions column in the MapReourceManager control.=========================================== if (!MapResourceManager1.Initialized) MapResourceManager1.Initialize(); LayerDefinitionCollection layDesCol = (LayerDefinitionCollection)MapResourceManager1.ResourceItems[0].LayerDefinitions; for (int i = 0; i < layDesCol.Nodes.Count; i++) { if (layDesCol.Nodes[i].Text == "States") // here "States" is the layer name, replace with your layer name which you want to customize { LayerDefinition layDef = (LayerDefinition)layDesCol.Nodes[i].Data; layDef.LayerFormat.Fields[3].Visible = false; layDef.LayerFormat.Fields[4].Visible = false; layDef.LayerFormat.Fields[5].Visible = false; MapResourceManager1.ResourceItems[0].UpdateLayerDefinitions(); } }===========================================