VB.NET+AJAX搜索建议功能的实现
IDE:Visual Web Developer 2008 Express Edition
数据库:Access 2007
到http://www.asp.net/ajax/downloads/下载AJAX Control Toolkit,将AjaxControlToolkit.dll拷贝到项目的bin目录下,在工具栏中引入。
WebService的代码:(aaa.asmx)
Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim dbname As String
dbname = Server.MapPath("location.accdb")
myConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;DATA Source=" & dbname)
myConnection.Open()
Dim list As New List(Of String)
myCommand = New OleDbCommand("SELECT DISTINCT(columnName) from tableName WHERE columnName LIKE '" + prefixText & "%" + "'", myConnection)
Dim reader As OleDbDataReader = myCommand.ExecuteReader()
Do While reader.Read
list.Add(reader.GetString(0))
Loop
Return list.ToArray()
End Function
FORM中的代码:(aaa.aspx)
<asp:TextBox ID="txtNo" runat="server" autopostback="true" Columns="50"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="txtNo_AutoCompleteExtender" runat="server" Enabled="True" ServiceMethod="GetCompletionList" ServicePath="aaa.asmx" TargetControlID="txtNo" MinimumPrefixLength="1" EnableCaching ="true">
</ajaxToolkit:AutoCompleteExtender>
以上即可。
AJAX日期控件的使用也很方便,如:
<asp:TextBox ID="txtDate" runat="server" Columns="24"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="txtDate_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDate">
</ajaxToolkit:CalendarExtender>
相关文档:
http://www.webuc.net/ddf3/archive/2005/08/25/6142.aspx
不用FSO的复制文件夹得方法?
用API函数 SHFileOperation
以下是使用SHFileOperation删除复制移动文件的例子,可以复制文件夹
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pfrom As String
pTo As String
fFlags As ......
AjaxPro.2.dll 的使用实例(2008-09-20 11:13:25)标签:ajax it 分类:ajax
准备工作:项目中要引用AjaxPro.2.dll,这个步骤就省略了,哈哈
第一步:web.config
<system.web>
<httpHandlers>
<add verb ......
<scrīpt Language="Javascrīpt">
<!--
// author:奔腾的心
// qq:7180001
function Ajax(OnError,OnState,OnDownloadEnd)
{
this.ErrorStr = null;
......
<mce:script type="text/javascript"><!--
function login(){
var postURL = "http://localhost:8080/cas/simpleLogin";
var params = {
"loginUrl":$("#loginUrl").val(),
"service":$("#service").val(),
"login":$( ......
从众多客户期盼已久的Ajax界面在V4.0.0版本中揭开了面纱以来,拓波软件在后续的历次版本更新中都延用并不断完善Ajax界面这个功能。大家可以下载测试版感受一下,或者登陆Turbomail网络在线版体验:
Web网址:http://mail.turbomail ......