C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Using Ajax AutoCompleteExtender


Posted Date: 09 May 2008    Resource Type: Code Snippets    Category: AJAX
Author: archanaMember Level: Gold    
Rating: Points: 10



An Example of using Ajax


'------Code in AutoExtenderEx.aspx:-------------
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:TextBox ID="TextBox1" runat="server" autocomplete="off"></asp:TextBox>
<cc1:autocompleteextender
runat="server"
ID="AutoCompleteExtender1"
ServicePath="Service.asmx"
ServiceMethod="GetAppNos"
MinimumPrefixLength="1"
TargetControlID="TextBox1">

</cc1:autocompleteextender>

Properites of autocompleteextender:
(1)ServicePath : This the the path of Web service the AutoCompleteExtender will
access.
(2)ServiceMethod : This is the method present in specified WebService.This
method will be called whenever the text changes in the TextBox1(Target
Control)
(3)MinimumPrefixLength : This is the minimun number of characters required to type in TextBox1(Target Control)
(4) TargetControlId : Id of the target control

'----The below is the method in Webservice()------------
_
_
Public Function GetAppNos(ByVal prefixText As String, ByVal count As Integer) As String()
Dim cnn As OracleConnection = New OracleConnection(ReplaceWithurconnstring)
Dim adp As OracleDataAdapter
adp = New OracleDataAdapter("select * from Application where APP_NO like '" + prefixText + "%'", cnn)
Dim daset As Data.DataSet = New Data.DataSet
adp.Fill(daset, "aaa12")
Dim temp As New List(Of String)
For i As Integer = 0 To daset.Tables(0).Rows.Count - 1
temp.Add(daset.Tables(0).Rows(i).Item(0).ToString())
Next
Return temp.ToArray
End Function




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to write ScriptManager and Javascripts for Ajax
Previous Resource: Solution for Dropdownlist or List to fit the lenghty items. (ASP.NET)
Return to Discussion Resource Index
Post New Resource
Category: AJAX


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use