Michael Seltenreich
Michael Seltenreich

Reputation: 3488

cannot seem to install ajax control toolkit

It seems my problem has very little documentation and all the solutions I've found online don't seem to work.

I am trying to install the Ajax Control Toolkit using the NuGet on Visual Studio 2012. I follow the installation instructions perfectly. This installs Ajax Control Toolkit and all of its dependencies.

I am prompted that the web.config has changed. I approve and reload it.

I am trying to create something:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server" />
    </div>
    </form>
</body>
</html>

but when I build the project I get two errors:

Error   1   Unknown server tag 'asp:ScriptManager'. C:\inetpub\wwwroot\comicosmos v1\Default.aspx   17  
Error   2   Reference required to assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the base class 'System.Web.UI.ScriptControl'. Add one to your project. C:\inetpub\wwwroot\comicosmos v1\Default.aspx   1   1   comicosmos v1

I've spent all morning trying out the few solutions I've found online and none of them seem to do the trick.

this is my web.config file:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="DBConnectionString" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.webServer>
    <modules>
      <remove name="Session"/>
      <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
    </modules>
  </system.webServer>
  <system.web>
    <machineKey validationKey="4133A063FEA5E896924CBD3F9946EB1645356918B364DD9F9AE961155D74CE21F8C2A9FB54698236C59217F478626E441C6EC50520BA46613A023CD56481B601" decryptionKey="2106F8146327711C28DF30CC2940C8F7A95E4B5AAB355B1E7AEAC5638AE86FED" validation="SHA1" decryption="AES"/>
    <pages enableSessionState="true"/>
    <httpModules>
      <remove name="Session"/>
      <add name="Session" type="System.Web.SessionState.SessionStateModule"/>
    </httpModules>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
  </system.web>
</configuration>

Can anybody see what's generating the problems?

Thank you!

Upvotes: 0

Views: 1977

Answers (2)

user1708928
user1708928

Reputation: 1

In think you are using:

  <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

from Ajax Extentions

Instead You must use:

   <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                  </ajaxToolkit:ToolkitScriptManager>

from Ajax Tool Kit Toolbar.

Upvotes: 0

Uroš Goljat
Uroš Goljat

Reputation: 1816

This problem is not related to AjaxControlToolkit.

Your problem is related to ASP.NET run-time. Please check which version of .NET Framework are you targeting (in Project Properties Pane) it might be that you are targeting Client Profile version of .NET which doesn't contain the Web assemblies. Also check if you have System.Web.Extensions.dll in your bin folder.

And one thing that i noted, not directly connected to problem above: When you start using controls from AjaxControlToolkit you must replace ScriptManager control with ToolkitScriptManager.

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ToolkitScriptManager/ToolkitScriptManager.aspx

Hope this helps!

Upvotes: 1

Related Questions