views:

298

answers:

3

I tried using AJAX Control for my first time after I installed the AJAX Toolkit for ASP.NET. I created a new ASP.NET website and added the ConfirmbuttonExtender. After I run it without changing nothing I get this error:

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>

I tried connecting this Control with a button as I saw in a tutorial video or adding the ToolkitScriptManager but it gave me the same error.

Does anyone know how can I solve this error?

A: 

This is the source code:

Line 16:
Line 17:
Line 18: Line 20:

Aviran
A: 

The ConfirmButtonExtender is not under System.Web.Extensions.

First you need to add a reference to your AjaxControlKit in your project. Then you can add the controls on your web config something like this:

<pages>
  <controls>
    ....
    <add tagPrefix="act" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
  </controls>
</pages>

Once you've done this the you can use your ajax control like in the following example:

<act:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" ConfirmText="are you sure" 
TargetControlID="Button1">
</act:ConfirmButtonExtender>
alejandrobog
I tried it now and I got an error:Error 1 Unknown server tag 'act:ConfirmButtonExtender'. C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite1\Default.aspx 12
Aviran
Do you add a reference to your AjaxControlToolkit.dll in your projectand the tagPrefix in your web config? (The first 2 steps i write below)
alejandrobog
I installed the AJAX ToolKit controls if that what you mean by "a reference to your AjaxControlToolkit.dll", and I added the tagPrefix as you wrote it.
Aviran
I installed AJAX ToolKit to the Toolbox, so I am not so sure if that is what you mean.
Aviran
A: 
  • What Visual Studio Version?
  • Have you created an Ajax enabled Website?
  • Have you installed an earlier Toolkit Version as 3.5 before?
  • Have you added a reference to the AjaxControlToolkit.dll to the Project?

Have a look here: http://stackoverflow.com/questions/40116/how-do-i-install-and-use-the-asp-net-ajax-control-toolkit-in-my-net-3-5-web-appl and here: http://msdn.microsoft.com/en-us/library/bb386580.aspx

Tim Schmelter
What Visual Studio Version?I have Visual Studio 2005.Have you created an Ajax enabled Website?I tried creating it, but I had no option to. I searched for an answer over the internet but I coudn't find it.Have you installed an earlier Toolkit Version as 3.5 before?Yes.Have you added a reference to the AjaxControlToolkit.dll to the Project?I added the ToolKit to my toolbox by selecting the AjaxControlToolkit.dll file. What do you mean by adding a reference to this project? and how can I do that?
Aviran