I hate it when an item in a form makes an ajax request and then I lose focus where I was at in the form. Here is the RadAjax solution I came up with to solve this problem. There's probably 100 solutions to this, but here's what I did.
In the Page_Load I check to see if there was an ajax request, and if there was, set the focus. "radAjaxManager" is the ID of my RadAjaxManager control.
//Maintain cursor position on ajax postback
var rad = RadScriptManager.GetCurrent(this.Page);
string ajaxTrigger = rad.AsyncPostBackSourceElementID;
Control c = rad.FindControl(ajaxTrigger);
if (c != null)
{
if (!string.IsNullOrEmpty(ajaxTrigger) && !ajaxTrigger.Contains("radAjaxManager"))
{
radAjaxManager
}
}
In the Page_Load I check to see if there was an ajax request, and if there was, set the focus. "radAjaxManager" is the ID of my RadAjaxManager control.
//Maintain cursor position on ajax postback
var rad = RadScriptManager.GetCurrent(this.Page);
string ajaxTrigger = rad.AsyncPostBackSourceElementID;
Control c = rad.FindControl(ajaxTrigger);
if (c != null)
{
if (!string.IsNullOrEmpty(ajaxTrigger) && !ajaxTrigger.Contains("radAjaxManager"))
{
radAjaxManager
.FocusControl(c.ClientID);}
}