AjaxControlToolkit.CommonToolkitScripts error

扶醉桌前 提交于 2019-12-24 09:47:58

问题


I got following code in my asp.net application

 <aspext:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
      <Scripts>
           <asp:ScriptReference Name="AjaxControlToolkit.Common.Common.js" Assembly="AjaxControlToolkit" />
           <asp:ScriptReference Name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" Assembly="AjaxControlToolkit" />
      </Scripts>
 </aspext:ToolkitScriptManager>
 <asp:Panel ID="Panel1" runat="server" />

 <script type="text/javascript" language="javascript">
      function getPosition() {
           //alert( $common.getLocation($get("<%=Panel1.ClientID %>")).x);
           var commonObj = new AjaxControlToolkit._CommonToolkitScripts();
           $common.setBounds($get("<%=Panel1.ClientID %>"),
           {
                x : 100,
                y : 200,
                width : 200,
                height : 100
           }
      }
 </script>

but I am getting this error:

The assembly 'AjaxControlToolkit, Version=4.1.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' does not contain a Web resource that has the name 'AjaxControlToolkit.Common.Common.js'. Make sure that the resource name is spelled correctly. Make sure that the application references the correct version of an ASP.NET AJAX Framework assembly

how to fix it?


回答1:


Please try using this code, use ScriptManager instead of ToolkitScriptManager

<asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Name="AjaxControlToolkit.Common.Common.js" Assembly="AjaxControlToolkit" />
                <asp:ScriptReference Name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" Assembly="AjaxControlToolkit" />
            </Scripts>
</asp:ScriptManager>

In reference to asp.net forum



来源:https://stackoverflow.com/questions/5191832/ajaxcontroltoolkit-commontoolkitscripts-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!