New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Redirect to Another Page from the Server

Environment

Product Progress® Telerik® UI for ASP.NET AJAX

Description

How can I redirect to a new page from the server with Telerik UI for ASP.NET AJAX?

Solution

To redirect to a new page from the server, use wither of the following approaches:

  • Use the Response.Redirect(), which is the standard ASP.NET way of redirection.

  • Generate JavaScript that sets window.location.href.

If Response.Redirect() does not work for you, for example, if called during partial rendering, you can use the script generation approach through a RadAjaxControl.Redirect() server method exposed by the AjaxManager and the AjaxPanel. This Telerik method registers JavaScript code that uses the window.location.href property to navigate to a new URL while providing you with the convenience of using a simple server method.

The following example demonstrates how to use Redirect() of the AjaxManager.


RadAjaxManager1.Redirect("http://www.google.com/");
//or
RadAjaxManager.GetCurrent(Page).Redirect("http://www.google.com/");

RadAjaxManager1.Redirect("http://www.google.com/")
'or
RadAjaxManager.GetCurrent(Page).Redirect("http://www.google.com/")

The following example demonstrates how to use Redirect() of the AjaxPanel.


RadAjaxPanel1.Redirect("http://www.google.com/");

RadAjaxPanel1.Redirect("http://www.google.com/")

See Also

In this article