DE:Visual Web Developer 2008 Express Edition
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比開化網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式開化網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋開化地區(qū)。費用合理售后完善,十多年實體公司更值得信賴。
DB:Access 2007
到http://www.asp.net/ajax/downloads/下載AJAX Control Toolkit,將AjaxControlToolkit.dll拷貝到項目的bin目錄下,在工具欄中引入。
在Web.config的
[xhtml] view plain copy
< add tagPrefix = "ajaxToolkit" namespace = "AjaxControlToolkit" assembly = "AjaxControlToolkit" />
WebService的代碼:(aaa.asmx)
[vb] view plain copy
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)
[xhtml] view plain copy
< 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日期控件的使用也很方便,如:
[xhtml] view plain copy
< asp:TextBox ID = "txtDate" runat = "server" Columns = "24" > asp:TextBox >
< ajaxToolkit:CalendarExtender ID = "txtDate_CalendarExtender" runat = "server" Enabled = "True" TargetControlID = "txtDate" >
ajaxToolkit:CalendarExtender >
如果您覺得此篇文章對您有幫助,歡迎關(guān)注微信公眾號:大禹編程,您的支持是對我最大的鼓勵!共同學習,共同進步:)