2

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?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316

1 Answers1

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

Harsh Baid
  • 7,199
  • 5
  • 48
  • 92
  • 1
    I used it and got: 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. – DotnetSparrow Mar 04 '11 at 10:24
  • @DotnetSparrow Try ` /* .. */ ` tag. In reference to http://www.asp.net/downloads/35-sp1/readme#_Toc198012546 – Harsh Baid Mar 04 '11 at 10:30
  • @Harsh: I used it but same error. – DotnetSparrow Mar 04 '11 at 10:54
  • @DotnetSparrow Hey the above Scripts are for .NET 3.5 sp1 as the link http://www.asp.net/downloads/35-sp1/readme#_Toc198012546 states and you are using .NET Framework 4, I think that might be problem with this. – Harsh Baid Mar 04 '11 at 12:04
  • @DotnetSparrow Also check the version of `AjaxControlToolkit.dll`, it `should be 3.5` or more and `not 1.0` – Harsh Baid Mar 04 '11 at 12:06