ASPxWebControl.GetCallbackErrorMessage() Method
Obtains the error info while processing the redirection page.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
Declaration
public static string GetCallbackErrorMessage()
Public Shared Function GetCallbackErrorMessage As String
Returns
Type | Description |
---|---|
String | A string value representing the error info. |
Remarks
When a server error occurs during a callback processing, and the request is redirected to a specific page (which is specified via the callbackErrorRedirectUrl option within a specific <devExpress> section of the Web.Config file), you can use the static GetCallbackErrorMessage method to obtain the error info within the redirection page.
See Response Redirection on Callback Exceptions to learn more.
Examples
In this example, the error message is displayed within the redirected page (Error.aspx) after an exception occurs on a callback within the Default.aspx page.
The redirection page is specified within the devExpress -> errors section of the web.config file via the callbackErrorRedirectUrl key (see Redirection on a Callback Error). The error message is obtained by using the static ASPxWebControl.GetCallbackErrorMessage method.
NOTE
To provide the message redirection between pages, the ASPxHttpHandlerModule should be registered within the web.config file.
- Default.aspx (C#)
- Default.aspx.cs
- Error.aspx (C#)
- Error.aspx.cs
- Error.aspx (VB.NET)
- Default.aspx.vb
- Default.aspx (VB.NET)
- Error.aspx.vb
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1" Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<dx:ASPxButton id="ASPxButton1" runat="server" AutoPostBack="False" text="Perform Callback">
<ClientSideEvents Click="function(s, e) { callback1.PerformCallback(); }"></ClientSideEvents>
</dx:ASPxButton>
<dx:ASPxCallback ID="ASPxCallback1" runat="server" ClientInstanceName="callback1"></dx:ASPxCallback>
</form>
</body>
</html>