Question

I am using ajaxcontrols and in that all controls are working well But I had not found any of the control named as ToolkitScriptManager so I had just copied this tag in .html page.

What shall I do? The version of framework in hosting server is 2.

My Web.config file is:

<pages>
  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
  </controls>
</pages>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" TagPrefix="cc1"/>
        <bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CS.aspx.cs" Inherits="CS" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .Star
        {
            background-image: url(images/Star.gif);
            height: 17px;
            width: 17px;
        }
        .WaitingStar
        {
            background-image: url(images/WaitingStar.gif);
            height: 17px;
            width: 17px;
        }
        .FilledStar
        {
            background-image: url(images/FilledStar.gif);
            height: 17px;
            width: 17px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </cc1:ToolkitScriptManager>
    <cc1:Rating ID="Rating1" AutoPostBack="true" OnChanged="OnRatingChanged" runat="server"
        StarCssClass="Star" WaitingStarCssClass="WaitingStar" EmptyStarCssClass="Star"
        FilledStarCssClass="FilledStar">
    </cc1:Rating>
    <br />
    <asp:Label ID="lblRatingStatus" runat="server" Text=""></asp:Label>
    </form>
</body>
</html>
Was it helpful?

Solution 2

Try using the ajaxToolkit prefix.

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

same for Rating control.

OTHER TIPS

For newer versions of Ajax tool kit you have to use the asp script manager:

    <asp:ScriptManager runat="server">

I had this same error message at a customer site and noticed the web.config file was saved as a web.config.txt file. Reverting the file to a web.config file resolved this issue.

I am not saying everyone with the issue will have the same problem, but the permissions and settings may not allow a non developer to notice this uncommon issue to the same error.

There are plenty of causes like not having the control registered, etc. But the thing that solved my issue was.......

It's because the ToolkitScriptManager control instance is not present in the designer.cs file. First check if the ajaxControlToolkit instance is present in designer.cs file and if not, Paste below code manually in the designer.cs file and it should fix it

    /// <summary>
    /// SMMain control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::AjaxControlToolkit.ToolkitScriptManager SMMain;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top