atlas:AutoCompleteExtender Demo

转载 2006年05月29日 11:59:00
AutoComplete.aspx

<%@ Page Language="C#" ClassName="Samples.ScriptManagerControl" %>

<!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>AutoCompleteExtender Control Sample</title>

    <atlas:ScriptManager runat="server" />

</head>
<body>

    <form id="form1" runat="server">
    <div>
        <h1>AutoCompleteExtender Control Sample</h1>
        <p>This sample demonstrates the use of an <a href="../Microsoft.Web.UI.Controls/AutoCompleteExtender/default.aspx">AutoCompleteExtender</a> control. As soon as you type a letter, a drop-down panel with possible completion values appears below the text box. Use either the mouse or arrow keys to select one of the suggestions, or keep typing for more options.</p>

        <p>Search Text: <asp:TextBox ID="searchText" runat="server" /></p>
        <atlas:AutoCompleteExtender ServicePath="AutoCompleteService.asmx" ServiceMethod="GetSuggestions" MinimumPrefixLength="1" runat="server">
            <atlas:AutoCompleteProperties TargetControlID="searchText" Enabled="true" />
        </atlas:AutoCompleteExtender>
    </div>
    </form>

</body>
</html>


AutoCompleteService.asmx
<%@ WebService Language="C#" Class="SamplesService" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class SamplesService  : System.Web.Services.WebService {

    [WebMethod]
    public string[] GetSuggestions(string prefixText, int count) {
        string[] r = new string[count];
        for (int i = 0; i < r.Length; i++)
            r[i] = string.Format("{0} ({1})", prefixText, i);
        return r;
    }
}

Web.config
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

  <configSections>
    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
      <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection" requirePermission="false" />
      <section name="webServices" type="Microsoft.Web.Configuration.WebServicesSection" requirePermission="false" />
      <section name="authenticationService" type="Microsoft.Web.Configuration.AuthenticationServiceSection" requirePermission="false" />
      <section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <microsoft.web>
    <converters>
      <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
      <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
      <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
    </converters>
    <webServices enableBrowserAccess="true" />
  </microsoft.web>
  <appSettings/>
  <connectionStrings/>
  <system.web>
    <pages>
      <controls>
        <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
        <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
      </controls>
    </pages>

    <compilation debug="false">
      <buildProviders>
          <add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider" />
      </buildProviders>
    </compilation>

    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>

      <add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/>
      <add verb="*" path="atlasglob.axd" type="Microsoft.Web.Globalization.GlobalizationHandler" validate="false"/>

      <add verb="*" path="*.asbx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
      <add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
      <add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/>
    </httpModules>
 
  </system.web>
</configuration>

相关文章推荐

Ajax 中 AutoCompleteExtender 的使用

====================================================== 注:本文源代码点此下载 =============================...

ajaxToolkit:AutoCompleteExtender

  • 2010-02-10 15:53
  • 545KB
  • 下载

使用AutoCompleteExtender实现搜索下拉提示框,读取数据库内容

转自:http://tech.ddvip.com/2009-03/1237358650111667.html 当我们输入的时候,下面出现搜索提示,下面我们来说一下实现的过程;  必备条件,如果你没有安...
  • lJean
  • lJean
  • 2011-05-25 16:32
  • 1235

ajaxToolkit:AutoCompleteExtender 用法详解

尽管有点难以置信, 但事实确实是, 在google搜索ajaxToolkit:AutoCompleteExtender , 我的一篇文章(ajaxToolkit:AutoCompleteExtende...

Ajax学习笔记(一):AutoCompleteExtender控件

AutoCompleteExtender:字面上翻译就是自动完成扩展控件 既然是扩展控件,就要依托于其他的控件。 AutoCompleteExtender的属性: TargetCon...

asp.net ajax 使用AutoCompleteExtender开发自动完成功能(转载)

====================================================== 注:本文源代码点此下载 =============================...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)