惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
Forbes - Security
Forbes - Security
S
Schneier on Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
NISL@THU
NISL@THU
T
Tenable Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
Schneier on Security
Schneier on Security
K
Kaspersky official blog
AI
AI
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threatpost
Attack and Defense Labs
Attack and Defense Labs
I
Intezer
The Cloudflare Blog
博客园 - 叶小钗
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
IT之家
IT之家
Recent Announcements
Recent Announcements
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
宝玉的分享
宝玉的分享
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
O
OpenAI News
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
Microsoft Security Blog
Microsoft Security Blog
B
Blog
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
D
Docker
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
H
Help Net Security
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - Arthur_wuancheng(大步牛)

练手之作:易元威客任务发布系统(2) 练手之作:易元威客任务发布系统(1) 人生一世 草木一秋 如何进行高效的项目管理?(转) 项目管理的一点总结 极限编程法一点思考 WEB Service 下实现大数据量的传输 (转) 项目经验(转) ajax for .net in vs2003 like gmail ^_^ 存储过程分页,以及动态sql(Sql server) C# 2.0 New Feature(1) WebService Enhancements 2.0 Learning Note ref type & out type Duwamish架构分析篇 (转) 程序编码应保持良好的规范(C#)(转) 也谈代码规范 (转) 如何用正确的方法来写出质量好的软件的75条体会 [转] How to Write to Database by EnterPriseLibrary2005 Logging Application Block(项目心得) 自己正在做电信的互联星空项目,里面用到的xml
Atlas 学习笔记: ajax 改进 by Atlas
Arthur_wuancheng(大步牛) · 2006-03-16 · via 博客园 - Arthur_wuancheng(大步牛)

废话不多说,今天试试atlas

1.       加入atlas 的 scriptManager   因为是后台直接调webservice  所以加上webservice的地址

        <atlas:ScriptManager ID="scriptManager" runat="server">
        
<Services>
            
<atlas:ServiceReference Path="WebService.asmx" />
        
</Services>
    
</atlas:ScriptManager>

2.         OK 在来一个text    注意在后面 spanid 要加一个名字 这个名字要和下面对应起来

    <input id="Text1" type="text" /><span id="Text1__autocomplete"></span>

3.        这段代码大家看看  指定  text1 要完成的行为   behaviors 里面指定了autoComplete 指定了方法serviceMethod="GetCompletionList"      minimumPrefixLength ="1" 指定你输入多少个字符就开始触发这个auto事件最后  completionList ="Text1__autocomplete" 这个名字和第二步的名字 要统一

  <script type="text/xml-script">
  
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
    
<components>
    
      
<label id="Text1" targetElement="Text1">
        
<behaviors>
          
<autoComplete serviceURL="WebService.asmx" serviceMethod="GetCompletionList" minimumPrefixLength="1" completionList="Text1__autocomplete" />
        
</behaviors>
      
</label>
      
    
</components>
    
<references>
    
</references>
  
</page>
</script>

4   下面来写webservice时候实现 的代码  基本上就是一个查询 注意返回值的类型

    [WebMethod]
    
public string[] GetCompletionList(string prefixText)
    
{
        
string temp = "";
        List
<string> suggestions = new List<string>();
        
if (prefixText != "")
        
{
            
string mySelectQuery = "SELECT ContactName FROM Customers where ContactName like '" + prefixText + "%'";
            SqlConnection myConnection 
= new SqlConnection(@"server=ZTE-WUANCHENG\wuancheng_zte;database=Northwind;User ID=sa;password=;Persist Security Info=true;");
            SqlCommand myCommand 
= new SqlCommand(mySelectQuery, myConnection);
            myConnection.Open();
            SqlDataReader myReader 
= myCommand.ExecuteReader();
            
            
try
            
{               
                
while (myReader.Read())
                
{
                    suggestions.Add(myReader.GetString(
0));
                    temp 
= temp + myReader.GetString(0+ "";
                }

                
            }

            
finally
            
{
                
// always call Close when done reading.
                myReader.Close();
                
// always call Close when done reading.
                myConnection.Close();
            }

        }



        
return suggestions.ToArray();
    }

5 . ok  看看效果

还可以把 参考了altas 的例子