0

I'm trying to add a ToolkitScriptManager to my page in order to use the AjaxControlToolkit. Here is my code:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestingAjaxWebPartUserControl.ascx.cs" Inherits="TestingAjax.TestingAjaxWebPart.TestingAjaxWebPartUserControl" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<html>
<body>
<form>
<cc1:ToolkitScriptManager runat="server" ID="toolkitScriptManager"></cc1:ToolkitScriptManager>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" 
         TargetControlID="TextBox2"
         ServiceMethod="GetCompletionList"
         ServicePath="TestingAjaxWebPartUserControl.ascx.cs"
         MinimumPrefixLength="2"
         CompletionInterval="1000"
         EnableCaching="true"
         CompletionSetCount="10">
        </cc1:AutoCompleteExtender>
</form>
</body>
</html>

However, when I load the page it throws an error saying that only one instance of a script manager can be running. I've been working on this problem almost all day and it's driving me nuts. Where could another script manager be and how do I disable it so that my page will load?

4

3 回答 3

0

您需要在表单标签内有 asp.net 控件和 ajax 控件。

于 2011-06-30T18:40:30.357 回答
0

尝试在正文中的所有内容周围放置一个表单标签...

<body>
    <form id="form1" runat="server">
        <cc1:ToolkitScriptManager runat="server" ID="toolkitScriptManager">
        </cc1:ToolkitScriptManager>
        ...
    </form>
</body>
于 2011-06-30T18:32:19.860 回答
0

检查您在页面或母版页中引用的用户控件(如果有)?

于 2011-06-30T18:26:21.423 回答