Back to Devexpress

Redirect a Response on a Callback Exception

aspnet-8888-common-concepts-callbacks-handle-callback-exceptions-redirect-response-on-callback-exception.md

latest1.7 KB
Original Source

Redirect a Response on a Callback Exception

  • Dec 27, 2023

When a callback exception occurs, you can redirect the application to another web resource in the following ways:

On the redirection page, you can call the static GetCallbackErrorMessage() method to obtain exception-related information.

csharp
public partial class Error : Page {
    protected void Page_Load(object sender, EventArgs e) {
        string errorMessage = ASPxWebControl.GetCallbackErrorMessage();
        Response.Output.Write(errorMessage);
    }
}
vb
Public Partial Class [Error]
    Inherits Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim errorMessage As String = ASPxWebControl.GetCallbackErrorMessage()
        Response.Output.Write(errorMessage)
    End Sub
End Class

See Also

Callbacks