English

Error: Parser Error: ESRI.ArcGIS.Server.WebControls.xxx must have items of type 'ESRI.ArcGIS.Server.WebControls.xxx'.

Error Message

The following error message is received when running an ArcGIS Server Web application after modifying the properties for an ESRI control in Visual Studio .NET.

"An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:
ESRI.ArcGIS.Server.WebControls.ToolbarItemCollection must have items of type
'ESRI.ArcGIS.Server.WebControls.ToolbarItem. 'ESRI.ArcGIS.Server.WebControls.Tool' is of
type 'System.Web.UI.HtmlControls.HtmlGenericControl'."

Cause

The error occurs because the html tags for some of the ESRI controls are modified.

Solution or Workaround

To resolve the issue you will need to update the @Register directive then you can search and replace all instances of the ESRI.ArcGIS.Server.WebControls tag with the esri: tag.

  1. Open the application in Visual Studio .NET and go to HTML view for the Web form that contains the ESRI controls.
  2. Replace the existing @Register directive with the following:
    <%@ Register TagPrefix="esri" Namespace="ESRI.ArcGIS.Server.WebControls" Assembly="ESRI.ArcGIS.Server.WebControls, Version=9.1.0.722, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" %>

  3. Search the HTML view and replace all instances of
    Code:
    <%@ Register TagPrefix="esri" Namespace="ESRI.ArcGIS.Server.WebControls"
    Assembly="ESRI.ArcGIS.Server.WebControls, Version=9.1.0.722, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86" %>

    where xxx is the name of the ESRI control, for example Tool, Commmand or BuddyControl.