This documentation is archived and is not being maintained.

ParserErrorCollection Class

Note: This class is new in the .NET Framework version 2.0.

Manages a set of parser errors detected during parsing. This class cannot be inherited.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public ref class ParserErrorCollection sealed : public CollectionBase
/** @attribute SerializableAttribute() */ 
public final class ParserErrorCollection extends CollectionBase
public final class ParserErrorCollection extends CollectionBase

The ParserErrorCollection class provides methods and properties that you can use to manage a collection of ParserError objects. For example, you can add a set of parser errors to a collection upon parsing while using a custom BuildProvider object to report all parse exceptions caught during parsing.

To add parser errors to, remove them from, or locate them in a collection, use the following:

  • The Add method to add a single ParserError object to the collection.

  • The AddRange methods to add multiple ParserError objects to the collection.

  • Both the Insert method and the Item property, which is the ParserErrorCollection indexer, to add a single ParserError object to the collection at the specified index.

Additionally, you can use the ParserErrorCollection class to do the following:

  • Remove ParserError objects with the Remove method.

  • Check whether a particular ParserError is in the collection by using the Contains method.

  • Find where a ParserError object is located in the collection by using the IndexOf method.

The following code example demonstrates how to use the ParserErrorCollection methods.

No code example is currently available or this language may not be supported.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0