Skip to main content
All docs
V25.1
  • Response.Redirect cannot be called in a Page callback

    Error Description

    This error can occur when you use the HttpResponse.Redirect method to navigate to another page on a callback. A callback request expects a response from the same page and a redirect to another page causes the “Response.Redirect cannot be called in a Page callback” error.

    Solution

    Use the RedirectOnCallback(String) method to redirect a page to the specified URL when server-side processing is complete:

    For v14.2 and earlier (BC2626):

    string TARGET_URL = ...;  
    if(Page.IsCallback)  
        DevExpress.Web.ASPxWebControl.RedirectOnCallback(TARGET_URL);  
    else  
        Response.Redirect(TARGET_URL);  
    

    For v14.1 and older:

    string TARGET_URL = ...;  
    if(Page.IsCallback)  
        DevExpress.Web.ASPxWebControl.RedirectOnCallback(TARGET_URL);  
    else  
        Response.Redirect(TARGET_URL);