0

I am learning ASP.net Ajax. I want to pull data from a db table and populate it on a grid as shown in the following tutorial.

http://dotnetslackers.com/articles/ajax/aspnetajaxgridandpager.aspx

 <asp:ScriptManager ID="TheScriptManager" runat="server">
  <Services>
    <asp:ServiceReference Path="~/DataService.asmx" />
  </Services>
</asp:ScriptManager>
<ajax:Grid ID="grid1" runat="server"></ajax:Grid>

I have added reference to "ajaxcontroltoolkit.dll"

But I am getting the error "Unknown server tag 'ajax:Grid' ". After some search I found this solution from the following website.

http://www.dotnetspider.com/forum/271778-DataGrid-AJAX.aspx

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1 or asp" %>

But this solution is not working for me.

How can I resolve this error.

Thanks in advance.

Sandeep
  • 7,156
  • 12
  • 45
  • 57

2 Answers2

0

Try changing the TagPrefix attribute to "ajax" instead of "cc1 or asp".

Dave Brace
  • 1,809
  • 2
  • 16
  • 20
  • @Sandeep You most likely don't have the AjaxControlToolkit library referenced correctly in your site if you are still receiving the error. Make sure your web application has a reference to the library. Here is some more information on installing the Ajax Control Toolkit: http://stackoverflow.com/questions/40116/how-do-i-install-and-use-the-asp-net-ajax-control-toolkit-in-my-net-3-5-web-appl. – Dave Brace Feb 23 '11 at 06:03
0

I have discovered some problem with this project. So, inside Northwind solution we have two projects: web site Northwind and library Ajax.Control. What you have mentioned in your question was a control from this library. But, unfortunately, in my case, I have revealed that library was build using Framework 2.0 version but contain a reference to namespace System.Web.Extensions which belong as minimum to Framework 3.5. So, I have change target framework for Ajax.Control project to Framework 3.5 and all is working now.

apros
  • 2,848
  • 3
  • 27
  • 31