
AutoCompleteProperties的属性包括 属性名称 属性描述 备注
TargetControlID 指定要控制的控件的ID 一般为TextBox的ID
ServicePath 处理智能选择列表的Web Services路径
ServiceMethod 处理智能选择列表的网络服务服务 该方法一般包含两个参数(string prefixText, int count)
Enabled 是否可用
MinimumPrefixLength 最小前缀的长度大小 当输入长度达到最小的时候,便提供智能选择
一、查看web.config文件中是否存在如下配置(倘若没有请添加):
<system.web>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<system.web>
二、代码如下:
2_SimpleList_AutoComplete_DragandDrop.aspx文件
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="2_SimpleList_AutoComplete_DragandDrop.aspx.cs"
Inherits="_2_SimpleList_AutoComplete_DragandDrop" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!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>Untitled Page</title>