RadControls for ASP.NET AJAX RadAjaxManager and RadAjaxPanel both descend from RadAjaxControl that introduces the following methods:
Alert: This convenient method executes a JavaScript alert() on the client. Alert() takes a single string parameter for text to be displayed in the alert.
CopyC#
RadAjaxManager1.Alert("Please save your changes.");
CopyVB.NET
RadAjaxManager1.Alert("Please save your changes.")FocusControl: This method places focus on a specified control. FocusControl() takes a single parameter that can be the id of the control to focus on or an object reference to the control to focus on.
CopyC#
RadAjaxManager1.FocusControl(Button1);
CopyVB.NET
RadAjaxManager1.FocusControl(Button1)
GetAjaxEventReference: This method produces client side code that invokes the ajaxRequest() method.
CopyC#
RadAjaxManager1.GetAjaxEventReference(Button1.ClientID);
CopyVB.NET
RadAjaxManager1.GetAjaxEventReference(Button1.ClientID)
RaisePostBackEvent: This method triggers a server-side AjaxRequest event and allows you to pass a single string parameter to the event. AjaxRequest can also be triggered by the client-side ajaxRequest() function.
CopyC#
protected void Button1_Click(object sender, EventArgs e)
{
RadAjaxManager1.RaisePostBackEvent(DateTime.Now.ToString());
}
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
Label1.Text = e.Argument;
}
CopyVB.NET
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
RadAjaxManager1.RaisePostBackEvent(DateTime.Now.ToString())
End Sub
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
Label1.Text = e.Argument
End SubRedirect: This method navigates the browser to another web page. The method passes a single string parameter which is the URL to navigate to.
CopyC#
RadAjaxManager1.Redirect("http://www.telerik.com");
CopyVB.NET
RadAjaxManager1.Redirect("http://www.telerik.com")