本文介绍了命名空间“System.Web.UI.WebControls"中不存在类型或命名空间名称“ToolkitScriptManager"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误

 命名空间System.Web.UI.WebControls"中不存在类型或命名空间名称ToolkitScriptManager"(您是否缺少程序集引用?)命名空间System.Web.UI.WebControls"中不存在类型或命名空间名称ModalPopupExtender"(您是否缺少程序集引用?)命名空间System.Web.UI.WebControls"中不存在类型或命名空间名称Accordion"(您是否缺少程序集引用?)

我已经安装了 ajaxControlToolKit 并且在我的 web.config 文件中有这个

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

我的 .aspx 页面

 
</asp:ToolkitScriptManager><asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="MPBehaviorIDOpen"TargetControlID="btnPopupRender" PopupControlID="panelOpen" BackgroundCssClass="modalBackground"PopupDragHandleControlID="panelOpenHead" OkControlID="btnOKOpen" CancelControlID="btnCancelOpen"/><asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BehaviorID="MPBehaviorIDResize"TargetControlID="btnPopupRender" PopupControlID="panelPageSize" BackgroundCssClass="modalBackground"PopupDragHandleControlID="panelPageSizeHead" OkControlID="btnPageSizeOK" CancelControlID="btnPageSizeCancel"/><div><asp:Button id="btnPopupRender" Height="0px" Width="0px" runat="server" style="display:none;"/>

<table style="height: 100%; vertical-align: top; width: 100%;"><tr><td style="height: 100%; vertical-align: top;"><asp:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"HeaderCssClass="accordionHeader" ContentCssClass="accordionContent"FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250"AutoSize="None" CssClass="accordionStyle" Width="140"><窗格><asp:AccordionPane ID="AccordionPane1" runat="server"><页眉>工具箱</页眉><内容><asp:ImageButton ID="btnOpen" runat="server" Width="40px" Height="40px"OnClientClick="ShowPopup(event,'MPBehaviorIDOpen'); return false;"ImageUrl="~/Images/open.png"/><br/><asp:Label ID="Label1" runat="server" Text="Open"></asp:Label><br/><br/><asp:ImageButton ID="btnPageSize" runat="server" Width="40px" Height="40px"OnClientClick="ShowPopup(event,'MPBehaviorIDResize'); return false;"ImageUrl="~/Images/paperSettings.png"/><br/><asp:Label ID="Label5" runat="server" Text="Page Size"></asp:Label><br/><br/><asp:ImageButton ID="btnDraw" runat="server" Width="40px" Height="40px"OnClientClick="SelectTool('pencil'); return false;"ImageUrl="~/Images/draw.png"/><br/><asp:Label runat="server" Text="Draw"></asp:Label><br/><br/><asp:ImageButton ID="btnText" runat="server" Width="40px" Height="40px"OnClientClick="SelectTool('text'); return false;"ImageUrl="~/Images/text.png"/><br/><asp:Label ID="Label2" runat="server" Text="Text"></asp:Label><br/><br/><asp:ImageButton ID="btnLine" runat="server" Width="40px" Height="40px"OnClientClick="SelectTool('line'); return false;"ImageUrl="~/Images/line.png"/><br/><asp:Label runat="server" Text="Line"></asp:Label><br/><br/><asp:ImageButton ID="btnSquare" runat="server" Width="40px" Height="40px"OnClientClick="SelectTool('rect'); return false;"ImageUrl="~/Images/square.png"/><br/><asp:Label runat="server" Text="Square"></asp:Label><br/><br/><asp:ImageButton ID="btnSave" runat="server" Width="40px" Height="40px"OnClientClick="SaveDrawings();return false;"ImageUrl="~/Images/save.png"/><br/><asp:Label ID="Label11" runat="server" Text="Save"></asp:Label><br/><br/><asp:ImageButton ID="btnExit" runat="server" Width="40px" Height="40px"OnClientClick="Exit();return false;"ImageUrl="~/Images/exit.png"/><br/><asp:Label ID="Label3" runat="server" Text="Exit"></asp:Label><br/><br/></内容></asp:AccordionPane></窗格></asp:手风琴></td><td style="height: 100%; vertical-align: top; "><div id="容器"><canvas id="imageView"></canvas>

</td></tr><div id="panelOpen" class="modalPopup" style="display:none;"><div id="panelOpenHead" class="popupHeader"><p>选择文件</p>

<div style="text-align:center;"><p><input id="fileUploadImg" type="file" accept="image/*"/></p><p><input type="button" id="btnOKOpen" value="OK" onclick="UpdateCanvas(); return false;"/><input type="button" id="btnCancelOpen" value="Cancel"/></p>

<div id="panelPageSize" class="modalPopup" style="display:none;"><div id="panelPageSizeHead" class="popupHeader"><p>页面大小</p>

<div style="text-align:center;"><p>输入宽度:<input type="text" id="txtWidth" style="width:100px;"/>像素</p><p>输入高度:<input type="text" id="txtHeight" style="width:100px;"/>像素</p><p><input type="button" id="btnPageSizeOK" value="OK" onclick="Resize(); return false;"/><input type="button" id="btnPageSizeCancel" value="取消"/></p>

</表单>

这是我的 web.config 文件

 <?xml version="1.0" encoding="utf-8"?><!--有关如何配置 ASP.NET 应用程序的更多信息,请访问http://go.microsoft.com/fwlink/?LinkId=169433--><配置><configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/><sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><连接字符串><add name="DBCS" connectionString="data source=.; database=xxx;integrated security=SSPI" providerName="System.Data.SqlClient"/></connectionStrings><system.web><编译调试="true" targetFramework="4.5"/><认证模式=表单"><forms loginUrl="SelectUser.aspx" defaultUrl="SelectUser.aspx"/></认证><授权><拒绝用户=?"/></授权><会员资格><提供者><清除/><add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/></提供者></会员资格><个人资料><提供者><清除/><add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/></提供者></个人资料><roleManager enabled="false"><提供者><清除/><add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/><add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/></提供者></roleManager><pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"><controls><add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/><add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages></system.web><system.webServer><modules runAllManagedModulesForAllRequests="true"/></system.webServer><组件><add assembly="System.Data.Linq, 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"/><add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></组件><运行时><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><从属程序集><assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35"culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/></dependentAssembly><从属程序集><assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35"culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/></dependentAssembly><从属程序集><assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35"culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4"/></dependentAssembly><从属程序集><assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a"culture="neutral"/><bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0"/></dependentAssembly></assemblyBinding></运行时></配置>

我已经想办法摆脱这个错误,但我不能.请帮忙.提前致谢!

解决方案

它存在于命名空间 System.Web.UI.WebControls;

但是为了使用它,您必须安装 AJAX 工具包.

在使用 AJAX 工具包中的控件之前,您必须重新安装工具包脚本管理器.

你可以再做一件事.

1.从工具箱中删除 Ajax Control 选项卡.

2.重新添加选项卡并右键单击该选项卡,选择Choose Items并浏览到您自己项目中的AjaxControltoolkit.dll文件并按OK(确保您使用的是相同版本的ajax工具包您的 C# 版本).

3.清理并重建解决方案,您就可以开始使用了.

将这些程序集添加到您的 web.config

 <add assembly="System.Data.Linq, 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"/><add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></组件>

并将您的 tagfix 更改为 asp 而不是 ajaxToolkit.

我认为它会帮助你.

I am getting the following errors

  The type or namespace name 'ToolkitScriptManager' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?)
  The type or namespace name 'ModalPopupExtender' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?)
  The type or namespace name 'Accordion' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?)

I have installed ajaxControlToolKit already and I have this in my web.config file

<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"><controls>
    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
  </controls></pages>

My .aspx page

 <%@ Page Language="C#" AutoEventWireup="true"       CodeBehind="PaintBrushCanvas.aspx.cs" Inherits="VirtualClassroom.PaintBrushCanvas" %>
 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
 <!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Paint Brush</title>
 <style type="text/css">
  #container { position: relative; overflow: auto; scrollbar-base-color:#ffeaff;  }
  #imageView { border: 1px dashed #CCCCCC; margin: 5px; border-style: dotted; border-width: 1px; background-color: #FFFFFF; vertical-align: top;  }
  #imageTemp { position: absolute; top: 1px; left: 1px; margin: 5px; }
  #imageTempt { position: absolute; top: 1px; left: 1px; margin: 5px; }
</style>
<link href="../StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="CanvasUtils.js"></script>

 <script type="text/javascript">
    window.moveTo(0, 0);
    window.resizeTo(screen.width, screen.height);
 </script>
</head>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true">
</asp:ToolkitScriptManager>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="MPBehaviorIDOpen"
    TargetControlID="btnPopupRender" PopupControlID="panelOpen" BackgroundCssClass="modalBackground"
    PopupDragHandleControlID="panelOpenHead" OkControlID="btnOKOpen" CancelControlID="btnCancelOpen" />
<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BehaviorID="MPBehaviorIDResize"
    TargetControlID="btnPopupRender" PopupControlID="panelPageSize" BackgroundCssClass="modalBackground"
    PopupDragHandleControlID="panelPageSizeHead" OkControlID="btnPageSizeOK" CancelControlID="btnPageSizeCancel" />

<div>
    <asp:Button id="btnPopupRender" Height="0px" Width="0px" runat="server" style="display:none;" />
</div>
<table style="height: 100%; vertical-align: top; width: 100%;">
    <tr>
        <td style="height: 100%; vertical-align: top;">
            <asp:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
                                HeaderCssClass="accordionHeader" ContentCssClass="accordionContent"
                                FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250"
                                AutoSize="None" CssClass="accordionStyle" Width="140">
             <Panes>
                <asp:AccordionPane ID="AccordionPane1" runat="server">
                  <Header>Toolbox</Header>
                  <Content>
                    <asp:ImageButton ID="btnOpen" runat="server"  Width="40px" Height="40px"
                                   OnClientClick="ShowPopup(event,'MPBehaviorIDOpen'); return false;" ImageUrl="~/Images/open.png" /><br />
                    <asp:Label ID="Label1" runat="server" Text="Open"></asp:Label><br /> <br />
                    <asp:ImageButton ID="btnPageSize" runat="server"  Width="40px" Height="40px"
                                   OnClientClick="ShowPopup(event,'MPBehaviorIDResize'); return false;" ImageUrl="~/Images/paperSettings.png" /><br />
                    <asp:Label ID="Label5" runat="server" Text="Page Size"></asp:Label><br /> <br />
                    <asp:ImageButton ID="btnDraw" runat="server"  Width="40px" Height="40px"
                                   OnClientClick="SelectTool('pencil'); return false;" ImageUrl="~/Images/draw.png" /><br />
                    <asp:Label runat="server" Text="Draw"></asp:Label><br /><br />
                    <asp:ImageButton ID="btnText" runat="server" Width="40px" Height="40px"
                                   OnClientClick="SelectTool('text'); return false;" ImageUrl="~/Images/text.png" /><br />
                    <asp:Label ID="Label2" runat="server" Text="Text"></asp:Label><br /><br />
                    <asp:ImageButton ID="btnLine" runat="server" Width="40px" Height="40px"
                                   OnClientClick="SelectTool('line'); return false;" ImageUrl="~/Images/line.png" /><br />
                    <asp:Label runat="server" Text="Line"></asp:Label><br /><br />
                    <asp:ImageButton ID="btnSquare" runat="server" Width="40px" Height="40px"
                                   OnClientClick="SelectTool('rect'); return false;" ImageUrl="~/Images/square.png" /><br />
                    <asp:Label runat="server" Text="Square"></asp:Label><br /><br />
                    <asp:ImageButton ID="btnSave" runat="server" Width="40px" Height="40px"
                                    OnClientClick="SaveDrawings();return false;"  ImageUrl="~/Images/save.png" /><br />
                    <asp:Label ID="Label11" runat="server" Text="Save"></asp:Label><br /><br />
                    <asp:ImageButton ID="btnExit" runat="server" Width="40px" Height="40px"
                                    OnClientClick="Exit();return false;"  ImageUrl="~/Images/exit.png" /><br />
                    <asp:Label ID="Label3" runat="server" Text="Exit"></asp:Label><br /><br />
                  </Content>
                </asp:AccordionPane>
             </Panes>
            </asp:Accordion>
        </td>
        <td style="height: 100%; vertical-align: top; ">
            <div id="container">
                <canvas id="imageView"></canvas>
            </div>
        </td>
    </tr>
</table>

<div id="panelOpen" class="modalPopup" style="display:none;">
    <div id="panelOpenHead" class="popupHeader">
        <p>Choose File</p>
    </div>
    <div style="text-align:center;">
        <p>
            <input id="fileUploadImg" type="file" accept="image/*"  />
        </p>
        <p>
            <input type="button" id="btnOKOpen" value="OK" onclick="UpdateCanvas(); return false;" />
            <input type="button" id="btnCancelOpen" value="Cancel" />
        </p>
    </div>
</div>

<div id="panelPageSize" class="modalPopup" style="display:none;">
    <div id="panelPageSizeHead" class="popupHeader">
        <p>Page Size</p>
    </div>
    <div style="text-align:center;">
        <p>
            Enter Width: <input type="text" id="txtWidth" style="width:100px;" /> px
        </p>
        <p>
            Enter Height: <input type="text" id="txtHeight" style="width:100px;" /> px
        </p>
        <p>
            <input type="button" id="btnPageSizeOK" value="OK" onclick="Resize(); return false;" />
            <input type="button" id="btnPageSizeCancel" value="Cancel" />
        </p>
    </div>
</div>

</form>
 </body>
</html>

This is my web.config file

  <?xml version="1.0" encoding="utf-8"?>
 <!--
 For more information on how to configure your ASP.NET application, please    visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions"      type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
      <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
      <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    </sectionGroup>
  </sectionGroup>
</sectionGroup>
</configSections>
<connectionStrings>
  <add name="DBCS" connectionString="data source=.; database=xxx; integrated    security=SSPI" providerName="System.Data.SqlClient" />
 </connectionStrings>


 <system.web>
   <compilation debug="true" targetFramework="4.5" />
    <authentication mode="Forms">
    <forms loginUrl="SelectUser.aspx" defaultUrl="SelectUser.aspx" />
    </authentication>
    <authorization>
    <deny users="?" />
   </authorization>
    <membership>
     <providers>
       <clear />
       <add name="AspNetSqlMembershipProvider"    type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
    </providers>
   </membership>
   <profile>
    <providers>
    <clear />
     <add name="AspNetSqlProfileProvider"   type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
  </providers>
  </profile>
  <roleManager enabled="false">
    <providers>
     <clear />
      <add name="AspNetSqlRoleProvider"   type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
    <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
  </providers>
</roleManager>
  <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"><controls>
      <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
     <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls></pages>
  </system.web>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
       </system.webServer>
        <assemblies>

       <add assembly="System.Data.Linq, 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"/>

      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
     </assemblies>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
         <assemblyIdentity name="Microsoft.Owin"        publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
    </dependentAssembly>
   <dependentAssembly>
     <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
     </dependentAssembly>
       <dependentAssembly>
      <assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-2.1.0.4" newVersion="2.1.0.4" />
    </dependentAssembly>
    <dependentAssembly>
    <assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
     <bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
     </dependentAssembly>
    </assemblyBinding>
        </runtime>
   </configuration>

I have goggled out to get rid of this error but I cant.Please help.Thanks in advance!!

解决方案

It exists in the namespace System.Web.UI.WebControls;

But in order to use it you have to install AJAX toolkit.

And before Using a Control from AJAX toolkit you have to reister the toolkit script manager.

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

You can to do one more thing.

1.Remove the Ajax Control tab from the toolbox.

2.Re-add the tab and right-click on the tab, Select Choose Items and browse to the AjaxControltoolkit.dll file in your own project and press OK(make sure that you are using the same version of ajax toolkit as of your C# version).

3.Clean and rebuild the solution and you are ready to go.

add these assemblies to you web.config

    <assemblies>

            <add assembly="System.Data.Linq, 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"/>

            <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

</assemblies>

and change your tagfix to asp instead of ajaxToolkit.

I think it will help you.

这篇关于命名空间“System.Web.UI.WebControls"中不存在类型或命名空间名称“ToolkitScriptManager"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 01:37