Aviran Cohen
Aviran Cohen

Reputation: 5691

Getting Started with AJAX ToolKit Controls

I am trying to make my first AJAX Control and I get error. I probbly missed some steps but I cann't find them eventhough I read many tutorials, probbly since I am new in AJAX, so I need to be guided step-by-step.

These are the steps I've already done:

  1. Downloading AJAX ToolKit.
  2. Adding These Controls to the ToolBox.
  3. creating new ASP.NET Website (I heard about AJAX-Enabled Option, but I dont have this option)
  4. Adding a AJAX Tool.

And thats it.

I read that I need to register add AjaxControlToolkit.dll in application bin folder, but I dont know how to do that and I dont have Bin Folder in my website, only App_Data Folder.

than I need to add this to the web config:

<add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>

than I need to add this to my website:

 <asp:ScriptManager ID="scriptmanager1" EnablePartialRendering="true" runat="Server" /> 

This is the error I receive:

"Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0012: The type 'System.Web.UI.ExtenderControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'."

Source Error:

Line 16:         <br />
Line 17:         <asp:Label ID="Label1" runat="server" Text="Label" Width="229px"></asp:Label><br />
Line 18:         <asp:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="are you sure"
Line 19:             TargetControlID="Button1">
Line 20:         </asp:ConfirmButtonExtender>

Does anyone know how can I solve this error?


I am using Visual Studio 2005.

Upvotes: 1

Views: 3697

Answers (3)

Raphael
Raphael

Reputation: 21

I hope that his answer is not to late. I also had this problem on my current solution: VS2008 AjaxControlToolkit for .NET 3.5. I have an installation on IIS6 and IIS7

The solution is to make the AjaxControlToolkit assemly as a known reference in the web.config.

you need to add the following lines to the web.

<system.web>
    <pages validateRequest="false">
    <controls>
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
    </controls>
</pages>

Upvotes: 2

Fred M
Fred M

Reputation: 11

Ajax toolkit should be in a directory on the C drive, such as c:\ajaxtoolkit then reference visual studio to use the dll from there.

It should NOT be in the project bin file. Why?

  1. What if you are working on multiple projects, then you will need multiple dll files. You don't have multiple frameworks 3.5 in your bin file.

  2. What if you have multiple projects on a team in a company? Every team member will be pointing to this projects bin folder?

  3. What if you delete the project? Where will studio refernce the toolbox dll?

  4. The build process puts files in the bin folder. Therefore you should be able to delete all the files in the bin folder though file manager before you create the next build.

If you have the toolkit in the bin folder, then stop working on that project. Its no longer on your PC. Open a new project.. you will not have ajax tools in your toolbox.

Fred M

Upvotes: 1

jason
jason

Reputation: 51

Add the bin folder to your application:

  • Right-click on the root directory in the Solution explorer (the name of your application folder in the sidebar on the right of the Visual Studio Screen)
  • Hover over "Add New ASP.NET Folder" and select "Bin"

Add reference to the toolkit assembly:

  • Right-click the bin folder and select "Add Reference"
  • Find "Ajax Control Toolkit" and select it

Upvotes: 1

Related Questions