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?

dserver
  • 39
  • 1
  • 8

3 Answers3

0

Check your usercontrol you are referring in the page or in the master page if any ?

Saurabh
  • 5,661
  • 2
  • 26
  • 32
  • I'm not sure I understand. My usercontrol is not in the master page; it's just in the .ascx page Visual Studio has created for me. Does that answer your question? – dserver Jun 30 '11 at 18:43
0

Try placing a form tag around everything inside the body...

<body>
    <form id="form1" runat="server">
        <cc1:ToolkitScriptManager runat="server" ID="toolkitScriptManager">
        </cc1:ToolkitScriptManager>
        ...
    </form>
</body>
Yetti
  • 1,710
  • 1
  • 14
  • 28
0

You need to have the asp.net controls and ajax controls inside the form tag.

Jayesh
  • 1,511
  • 1
  • 16
  • 37
  • @dserver If you are making a user control page, then it may be possible that a script manager exists in the page which calls this user control page. – Jayesh Jun 30 '11 at 19:21
  • yes, this was it. the root page was using a script manager. commenting it out allowed me to use my own. thank you – dserver Jul 01 '11 at 02:04