ParserError Class
TOC
Collapse the table of content
Expand the table of content

ParserError Class

 

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

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

System.Object
  System.Web.ParserError

[SerializableAttribute]
public sealed class ParserError

NameDescription
System_CAPS_pubmethodParserError()

Initializes a new instance of the ParserError class.

System_CAPS_pubmethodParserError(String, String, Int32)

Initializes a new instance of the ParserError class by using the specified error text, virtual path, and source line number.

NameDescription
System_CAPS_pubpropertyErrorText

Gets or sets a string that represents the error for the ParserError object.

System_CAPS_pubpropertyLine

Gets or sets the line number of the source at which the error occurs.

System_CAPS_pubpropertyVirtualPath

Gets or set the virtual path of the file that was being parsed when the error occurred.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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
Available since 2.0

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

Return to top
Show:
© 2016 Microsoft