Name

ClearError

Synopsis

Context.ClearError(  )

Clears all errors for the current request. Note that even though ClearError is singular, it clears all errors for the current request.

Parameters

None

Example

The example checks whether there are any errors and then clears them. Finally, it reports if it has cleared any errors.

Sub Page_Load(  )
   If Not Context.AllErrors Is Nothing Then
      Context.ClearError(  )
      Message.Text = "Errors cleared."
   Else
      Message.Text = "No Errors to clear."
   End If
End Sub

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.