Error: Unexpected ajax response was received from the server. This may be caused by one of the following reasons:
- Swerver.Transfer
- Custom http handler.
- Incorrect loading of an "Ajaxified" user control.
I started getting this error after I had moved my default grid property settings out of the grid html code, and into a code-behind routine that I call during page load:
protected
void Page_Load(object sender, EventArgs e)
{
WP_Utility wpUtility = new WP_Utility();
wpUtility.GridDefaults(rgData);
.....}
public
partial class WP_Utility
{
public void GridDefaults(RadGrid RadGrid1)
{
RadGrid1.Skin =
"Monochrome";
RadGrid1.Width =
Unit.Percentage(99);
RadGrid1.PageSize = 10;
RadGrid1.AutoGenerateColumns =
false;
RadGrid1.AllowPaging =
true;
RadGrid1.AllowSorting =
true;
RadGrid1.EnableAJAX =
true;
RadGrid1.EnableAJAXLoadingTemplate =
true;
RadGrid1.MasterTableView.PageSize = 10;
RadGrid1.HeaderStyle.Font.Size = 11;
RadGrid1.HeaderStyle.Font.Underline =
false;
RadGrid1.HeaderStyle.HorizontalAlign =
HorizontalAlign.Left;
RadGrid1.ItemStyle.Font.Size = 10;
RadGrid1.AlternatingItemStyle.Font.Size = 10;
RadGrid1.GridLines =
GridLines.None;
RadGrid1.PagerStyle.Mode =
GridPagerMode.NextPrevAndNumeric;
RadGrid1.PagerStyle.Font.Size = 11;
RadGrid1.PagerStyle.HorizontalAlign =
HorizontalAlign.Center;
RadGrid1.PagerStyle.PagerTextFormat =
"Page: {4} | Displaying page {0} of {1}";
}
}
The error goes away if I put:
EnableAJAX="True" EnableAJAXLoadingTemplate="True"
back into the grid html code.
Thought I would pass this along in case anyone else runs into this problem. Thanks.