Reputation: 979
I published this problem sometime ago. Someone showed me how to use jquery instead of ajax controls to solve my problem so I accepted that answer. I now find that I need ajax controls once again. In particular the AsyncFileUpload control because FileUpLoad is not working for me. So here is the issue again, slightly revised.
I am trying to add Ajax controls to my VS 2010 project. I have previously gotten it to work when I used VS2008. I keep getting this exception:
Error 1 The type 'System.Web.UI.ScriptControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Here’s what I did. I downloaded the ajax 4 toolkit and added a reference to the project. I also added a reference to system.web extension to my project. When I do this these lines get added to my web.config.
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
I added these lines to my aspx file.
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
And
<cc1:AsyncFileUpload ID="afuMine" runat="server" />
</asp:Content>
The obvious thing to try is to add a reference to System.Web.Extensions. Unfortunately that didn't help.
I also backed off and tried ajax 3.5, this didn’t help. I did notice that the ajax dll is 4.1 while the 'System.Web.Extensions is 4.0. I don’t know if this matters but I cannot find ajax 4.0 or 'System.Web.Extensions 4.1. Thanks once again in advance.
Upvotes: 0
Views: 3637
Reputation: 979
I found the answer in another forum and I wanted to share it with you. Like the poster, I'm not sure why it worked.
Upvotes: 1
Reputation: 68717
You referenced the System.Web.Extensions.Design
, the error is you need to reference System.Web.Extensions
. It's located in the AjaxControlToolkit dll. You should use
<assemblies>
...
<add assembly="AjaxControlToolkit"/>
</assemblies>
Upvotes: 1