Bewerken

Delen via


ParserError Constructors

Definition

Initializes a new instance of the ParserError class.

Overloads

ParserError()

Initializes a new instance of the ParserError class.

ParserError(String, String, Int32)

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

ParserError()

Initializes a new instance of the ParserError class.

public:
 ParserError();
public ParserError ();
Public Sub New ()

Examples

The following code example demonstrates how to initialize an empty instance of the ParserError class and how to use its properties.

ParserError MyParserError = new ParserError();

MyParserError.ErrorText = "My Error Text";

MyParserError.Line = 5;

MyParserError.VirtualPath = "MyPath";
Dim myParserError As New ParserError()
myParserError.ErrorText = "My Error Text"
myParserError.Line = 5
myParserError.VirtualPath = "MyPath"

Applies to

ParserError(String, String, Int32)

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

public:
 ParserError(System::String ^ errorText, System::String ^ virtualPath, int line);
public ParserError (string errorText, string virtualPath, int line);
new System.Web.ParserError : string * string * int -> System.Web.ParserError
Public Sub New (errorText As String, virtualPath As String, line As Integer)

Parameters

errorText
String

The error message text.

virtualPath
String

The virtual path of the file being parsed when the error occurred.

line
Int32

The line number of the error source.

Remarks

Use the ParserError constructor to initialize a ParserError object with custom settings. The ParserError constructor has the following properties:

  • The ErrorText property, which is a string containing the error message that is related to the parser error.

  • The VirtualPath property, which is a read-only string that specifies the virtual path of the file that contains the parser error.

  • The Line property, which is the line number within the file at which this ParserError object was thrown.

Applies to