Export (0) Print
Expand All

ParserError Class

Represents a parser error or warning. This class cannot be inherited.

System.Object
  System.Web.ParserError

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

'Declaration
<SerializableAttribute> _
Public NotInheritable Class ParserError

The ParserError type exposes the following members.

  NameDescription
Public methodParserErrorInitializes a new instance of the ParserError class.
Public methodParserError(String, String, Int32)Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number.
Top

  NameDescription
Public propertyErrorTextGets or sets a string that represents the error for the ParserError object.
Public propertyLineGets or sets the line number of the source at which the error occurs.
Public propertyVirtualPathGets or set the virtual path of the file that was being parsed when the error occurred.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

A ParserError object represents an error that is created when an HttpParseException exception is thrown. A parser error object can contain error message text, a virtual path to the file where the error occurred, and the subsequent line number of the error in that file. If more than one parser error occurs or you want to store multiple parser errors in a centralized location, use the ParserErrorCollection object.

A parser error is of the type HttpException. For more information on exceptions and how to handle them, go to MSDN Library.

The following code example demonstrates how to add a new parser error to a ParserErrorCollection object.

' Add a ParserError to the collection.
collection.Add(New ParserError("ErrorName", "Path", 1))

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

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