I get a "ASP.NET AJAX client-side framework failed to load" error when I do the following, using NA 2010 Volume 3 SR 2134, VS 2010 and .NET 4.0.
I have a webdatagrid binded to a sqldatasource, but the grid's visible property is set to false. I'm doing a google-like text search on the data source and gets a result back. Because there is a result, the grid is made visible and the first page is shown. I then click on the last page, the grid jumps to the last page. When I click the first page again I get the above error.
If I do the above, but keep the grid visible, the error is not displayed.
Has the visibility of the grid an impact on AJAX. Any ideas?
Hello Casper,
I tried to reproduce the issue in my environment but with no avail.
Can you provide us with an isolated sample reproducing the issue?
Hope hearing from you.
Hi Tsvetelina,
It's a bit difficult this month, but I'll see what I can do. Thanks.
Hi Casper,
Thank you for the update.
I've attached the page where this problem occurs. Unfortunately I cannot send everything so I hope this helps. I've commented out all the code lines where I reference the Irony library with no effect, So the problem is definitely either in my coding where I rebind or in the grid. The line that causes the error is in the Display() method where the controls' visibility is set. If I uncomment WebDataGrid1.Visible line everything works but if I comment it, then it doesn't work. Attached the coding.
Thank you for the sample and the clarification.
I was able to reproduce the issue with them both.
You are correct that Display(false); is causing the issue.
You are invoking it on every Page load.
I recommend you to do this only in the (!IsPostBack) section
if (!IsPostBack)
{
Display(false);
}
OR
to check if there is search string and data to be displayed and to invoke Display(true);
before setting the SearchCriteria and the DataSource.
if (IsPostBack)
String searchCriteria = "";
if (textBoxSearch.Text != String.Empty)
searchCriteria = textBoxSearch.Text;
else
searchCriteria = "1";
SqlDataSource1.SelectParameters["CategoryID"].DefaultValue = searchCriteria;
WebDataGrid1.DataSourceID = "SqlDataSource1";
WebDataGrid1.DataBind();
if (WebDataGrid1.Rows.Count > 0)
Display(true);
Please refer to the modified sample attached (using NorthWind dataBase) and let me know if you need further assistance regarding this