Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • This KB Article addresses the following questions:
                                    1) Why may the "Response.Redirect cannot be called in a Page callback" error occur?
                                    2) How to redirect a page while processing a callback request?

                                1 Solution

                                Creation Date Rating Importance Sort by
                                3

                                The HttpResponse.Redirect method cannot be used while processing a callback request because of specifics of its life cycle.
                                As a result, the "Response.Redirect cannot be called in a Page callback" error may occur.

                                When processing server-side operations invoked through a MS AJAX callback, ICallbackEventHandler (most of "large" DevExpress ASP.NET controls such as ASPxGridView, etc. perform server-side operations through callbacks), it is necessary to use the DevExpress.Web.ASPxClasses.ASPxWebControl.RedirectOnCallback method. It allows redirecting a page to the specified URL when server-side processing is completed:

                                [C#]
                                string TARGET_URL = ...; if(Page.IsCallback) DevExpress.Web.ASPxClasses.ASPxWebControl.RedirectOnCallback(TARGET_URL); else Response.Redirect(TARGET_URL);
                                [VB.NET]
                                Dim TARGET_URL As String = ... If Page.IsCallback Then DevExpress.Web.ASPxClasses.ASPxWebControl.RedirectOnCallback(TARGET_URL) Else Response.Redirect(TARGET_URL) End If
                                • Winanjaya @Primtek 04.27.2016
                                  Thanks a lot!
                                • Philip Johnston 09.01.2016
                                  Did you solve your issue I am having the problem on the scedulre but I have no redirects in the loop at all in my code behind it appeard on the control itself.
                                • Hello Philip,

                                  To process your inquiry more efficiently, I've created a separate ticket on your behalf (T422480: Response.Redirect cannot be called in a Page callback when the approach from KA18851 is used in ASPxScheduler). It has been placed in our processing queue and will be answered shortly.

                                • Slack 09.14.2017
                                  Since this post was around a year ago I believe the correct code to call is now:

                                  DevExpress.Web.ASPxWebControl.RedirectOnCallback(TARGET_URL);

                                  I am having an issue where everytime this executes from our MASTER PAGE, I get the following exception:

                                  Object reference not set to an instance of an object.

                                  I don't know if the code would change on a Master Page where this code would have to work universally for any DevExpress control on a child page that may be causing a callback when we need to redirect to our login screen instead.
                                • Hello,

                                  I've created a separate ticket on your behalf (ASPxGridView - How to call the RedirectOnCallback method in master page). It has been placed in our processing queue and will be answered shortly.

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2018 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners