Export (0) Print
Expand All
Key
M11
M12
M21
M22
Tag
Uri
X1
X2
Y1
Y2
Expand Minimize

LineNumber (ParserErrorEventArgs)

Silverlight

Gets or sets the line number at which the parser error occurred.

value = eventargs.LineNumber

Type: integer

The number of the line on which the parser error occurred.

This property is read/write but should be considered read-only because there is no reason to change the reported information. There is no default.

Because you cannot raise your own errors in the Silverlight JavaScript eventing model, the settable aspect of this property does not have a practical usage. Typically, you will use this property only to get its value.

The following JavaScript example shows the portion of an event handler that displays error information specific to parser errors.

// errorArgs is an instance of ParserErrorEventArgs.
    if(errorArgs.ErrorType == "ParserError")
    {
      var parserErrorMsg = "Silverlight Parser Error  \n\n";
               
      // Basic error event information.
      parserErrorMsg += "Error Type:    " + errorArgs.errorType     + "\n";
      parserErrorMsg += "Error Message: " + errorArgs.errorMessage  + "\n";
      parserErrorMsg += "Error Code:    " + errorArgs.errorCode  + "\n";
            
      //Parser-specific error event information.
      parserErrorMsg += "XamlFile:      " + errorArgs.xamlFile      + "\n";
      parserErrorMsg += "XmlElement:    " + errorArgs.xmlElement    + "\n";
      parserErrorMsg += "XmlAttribute:  " + errorArgs.xmlAttribute  + "\n";
      parserErrorMsg += "Line:          " + errorArgs.lineNumber    + "\n";
      parserErrorMsg += "Position:      " + errorArgs.charPosition  + "\n";
            
      // Display the error message.
      alert(parserErrorMsg);
    }

Community Additions

ADD
Show:
© 2015 Microsoft