I gotten one website that I downloaded to work with the autocomplete extender. I then created a new data scaffolding website using an ADO entity model. I have created a custom list form, which was generated by the data scaffolding, and am trying to put an autocomplete extender on it. I get a sys undefined error in internet explorer. I go into the debugger and see the error.
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AutoCompleteBehavior, {"completionSetCount":100,"delimiterCharacters":"","enableCaching":false,"id":"txtName_AutoCompleteExtender","minimumPrefixLength":2,"serviceMethod":"GetDevelopments","servicePath":"/SewerCleaningHeaders/List.aspx","useContextKey":true}, null, null, $get("ContentPlaceHolder1_txtName"));
});
sys undefined.
I downloaded the the 15.1.3 version of ajax control tookit. It has done away with toolkit script manager and replaced it with scriptmanager. Which is what I needed because the page generated by the datascaffolding already has a script manager in the site master.
The code for the site master is as follows:
<%@ Master Language="VB" CodeFile="Site.master.vb" Inherits="Site" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title>Dynamic Data Site</title>
<link href="~/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<h1 class="DDMainHeader">Dynamic Data Site</h1>
<div class="DDNavigation">
<a runat="server" href="~/"><img alt="Back to home page" runat="server" src="DynamicData/Content/Images/back.gif" />Back to home page</a>
</div>
<form id="form1" runat="server">
<div>
<%-- TODO: Enable partial rendering by setting the EnablePartialRendering attribute to "true" to provide a smoother browsing experience.
Leaving partial rendering disabled will provide a better debugging experience while the application is in development. --%>
<asp:ScriptManager id=ToolKitScriptManager1 runat="server" EnablePartialRendering="False" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/" Name="jquery" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" />
</Scripts>
</asp:ScriptManager>
the code in the custom form that I am only modifying is as follows ( with autocomplete extender on bottom)
<%@ Page Language="VB" MasterPageFile="~/Site.master" CodeFile="List.aspx.vb" Inherits="List" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
<DataControls>
<asp:DataControlReference ControlID="GridView1" />
</DataControls>
</asp:DynamicDataManager>
<h2 class="DDSubHeader"><%= table.DisplayName%></h2>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="DD">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
HeaderText="List of validation errors" CssClass="DDValidator" />
<asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" CssClass="DDValidator" />
<asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DisplayName") %>' OnPreRender="Label_PreRender" />
<asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" /><br />
</ItemTemplate>
</asp:QueryableFilterRepeater>
<br />
</div>
<asp:EntityDataSource ID="GridDataSource" runat="server" EnableDelete="true" />
<asp:Button ID="Button1" runat="server" Text="Search" />
<br />
<asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" EnablePersistedSelection="true"
AllowPaging="True" AllowSorting="True" CssClass="DDGridView"
RowStyle-CssClass="td" HeaderStyle-CssClass="th" CellPadding="6">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DynamicHyperLink runat="server" Action="Edit" Text="Edit"
/> <asp:LinkButton runat="server" CommandName="Delete" Text="Delete"
OnClientClick='return confirm("Are you sure you want to delete this item?");'
/> <asp:DynamicHyperLink runat="server" Text="Details" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="Add" DataNavigateUrlFormatString="~/SewerCleaningHeaders/Insert.aspx" />
</Columns>
<PagerStyle CssClass="DDFooter"/>
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
<EmptyDataTemplate>
There are currently no items in this table.
</EmptyDataTemplate>
</asp:GridView>
<div class="DDBottomHyperLink">
<asp:DynamicHyperLink ID="InsertHyperLink" runat="server" NavigateUrl=<%# table.GetActionPath("videolist", GetDataItem())%> Action="videolist"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" />Insert new item</asp:DynamicHyperLink>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label runat="server" ID="lblReferrerName" Text="Address: "></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:Label runat="server" ID="Label1" Text=" Select address and press button "></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Width="67px" />
<asp:AutoCompleteExtender ID="txtName_AutoCompleteExtender" BehaviorID="txtName_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True"
TargetControlID="txtName" MinimumPrefixLength="2" CompletionInterval="1000"
EnableCaching="false" FirstRowSelected="false" CompletionSetCount= "100" ServiceMethod="GetDevelopments"
UseContextKey="True">
</asp:AutoCompleteExtender>
<script src="~/Scripts/MicrosoftAjaxToolkit/MicrosoftAjax.js" type="text/javascript"></script>
<script src="~/Scripts/MicrosoftAjaxToolkit/Debug/AutoComplete.debug.js" type="text/javascript"></script>
</asp:Content>
I've never actually made one of my exsisting website work with the ajax am I missing something? I've worked on this for days and have tried many different things like copying the ajax control toolkit scripts, .js files to my website's scripts directory. Is that the wrong way to do it. They weren't there before. Tutorials that I've watched haven't even mentioned the script files but I saw it as one of the solutions.
Sys.Application.add_init(function() {
$create(Sys.Extended.UI.AutoCompleteBehavior, {"completionSetCount":100,"delimiterCharacters":"","enableCaching":false,"id":"txtName_AutoCompleteExtender","minimumPrefixLength":2,"serviceMethod":"GetDevelopments","servicePath":"/SewerCleaningHeaders/List.aspx","useContextKey":true}, null, null, $get("ContentPlaceHolder1_txtName"));
});
sys undefined.
I downloaded the the 15.1.3 version of ajax control tookit. It has done away with toolkit script manager and replaced it with scriptmanager. Which is what I needed because the page generated by the datascaffolding already has a script manager in the site master.
The code for the site master is as follows:
<%@ Master Language="VB" CodeFile="Site.master.vb" Inherits="Site" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title>Dynamic Data Site</title>
<link href="~/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<h1 class="DDMainHeader">Dynamic Data Site</h1>
<div class="DDNavigation">
<a runat="server" href="~/"><img alt="Back to home page" runat="server" src="DynamicData/Content/Images/back.gif" />Back to home page</a>
</div>
<form id="form1" runat="server">
<div>
<%-- TODO: Enable partial rendering by setting the EnablePartialRendering attribute to "true" to provide a smoother browsing experience.
Leaving partial rendering disabled will provide a better debugging experience while the application is in development. --%>
<asp:ScriptManager id=ToolKitScriptManager1 runat="server" EnablePartialRendering="False" >
<Scripts>
<asp:ScriptReference Path="~/Scripts/" Name="jquery" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" />
</Scripts>
</asp:ScriptManager>
the code in the custom form that I am only modifying is as follows ( with autocomplete extender on bottom)
<%@ Page Language="VB" MasterPageFile="~/Site.master" CodeFile="List.aspx.vb" Inherits="List" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
<DataControls>
<asp:DataControlReference ControlID="GridView1" />
</DataControls>
</asp:DynamicDataManager>
<h2 class="DDSubHeader"><%= table.DisplayName%></h2>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div class="DD">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
HeaderText="List of validation errors" CssClass="DDValidator" />
<asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" CssClass="DDValidator" />
<asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("DisplayName") %>' OnPreRender="Label_PreRender" />
<asp:DynamicFilter runat="server" ID="DynamicFilter" OnFilterChanged="DynamicFilter_FilterChanged" /><br />
</ItemTemplate>
</asp:QueryableFilterRepeater>
<br />
</div>
<asp:EntityDataSource ID="GridDataSource" runat="server" EnableDelete="true" />
<asp:Button ID="Button1" runat="server" Text="Search" />
<br />
<asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" EnablePersistedSelection="true"
AllowPaging="True" AllowSorting="True" CssClass="DDGridView"
RowStyle-CssClass="td" HeaderStyle-CssClass="th" CellPadding="6">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DynamicHyperLink runat="server" Action="Edit" Text="Edit"
/> <asp:LinkButton runat="server" CommandName="Delete" Text="Delete"
OnClientClick='return confirm("Are you sure you want to delete this item?");'
/> <asp:DynamicHyperLink runat="server" Text="Details" />
</ItemTemplate>
</asp:TemplateField>
<asp:HyperLinkField Text="Add" DataNavigateUrlFormatString="~/SewerCleaningHeaders/Insert.aspx" />
</Columns>
<PagerStyle CssClass="DDFooter"/>
<PagerTemplate>
<asp:GridViewPager runat="server" />
</PagerTemplate>
<EmptyDataTemplate>
There are currently no items in this table.
</EmptyDataTemplate>
</asp:GridView>
<div class="DDBottomHyperLink">
<asp:DynamicHyperLink ID="InsertHyperLink" runat="server" NavigateUrl=<%# table.GetActionPath("videolist", GetDataItem())%> Action="videolist"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" />Insert new item</asp:DynamicHyperLink>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label runat="server" ID="lblReferrerName" Text="Address: "></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:Label runat="server" ID="Label1" Text=" Select address and press button "></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Width="67px" />
<asp:AutoCompleteExtender ID="txtName_AutoCompleteExtender" BehaviorID="txtName_AutoCompleteExtender" runat="server"
DelimiterCharacters="" Enabled="True"
TargetControlID="txtName" MinimumPrefixLength="2" CompletionInterval="1000"
EnableCaching="false" FirstRowSelected="false" CompletionSetCount= "100" ServiceMethod="GetDevelopments"
UseContextKey="True">
</asp:AutoCompleteExtender>
<script src="~/Scripts/MicrosoftAjaxToolkit/MicrosoftAjax.js" type="text/javascript"></script>
<script src="~/Scripts/MicrosoftAjaxToolkit/Debug/AutoComplete.debug.js" type="text/javascript"></script>
</asp:Content>
I've never actually made one of my exsisting website work with the ajax am I missing something? I've worked on this for days and have tried many different things like copying the ajax control toolkit scripts, .js files to my website's scripts directory. Is that the wrong way to do it. They weren't there before. Tutorials that I've watched haven't even mentioned the script files but I saw it as one of the solutions.