Solved

Help with ajax auto suggestion textbox asp.net 1.1

Posted on 2006-11-07
6
796 Views
Last Modified: 2008-01-16
Hello experts, I am trying to create a suggest textbox for a asp.net web page I am developing.  I found lots of code but is not in vb.net.  My main problem is how do I select only the suggested text in the textbox so that the user can keep typing?

Here is  my ajax codebehind function that retrieves the suggestions from the database
  <Ajax.JavascriptMethod()> _
      Function check_name(ByVal first_name As String) As String
        Dim ssql As String
        Dim firstname As String
        ssql = "Select First_name from tablename where First_Name like '" & first_name.ToUpper & "%'"
        Dim dr As OracleDataReader
        dr = GetData(ssql)
        If dr.HasRows = True Then
            While dr.Read
                firstname = dr.GetString(0)
            End While
        End If
        Dim int As Integer = first_name.Length
        Return firstname.Remove(0, int).ToLower
    End Function

here is my aspx page with the javascript
<script language="javascript">
            function checkname()
            {
            document.getElementById('txtfirstname').value += check_name(document.getElementById('txtfirstname').value)
            }
</script>

<a onkeyup="checkname();"><asp:textbox id="txtfirstname" runat="server" BackColor="Cornsilk"></asp:textbox></a>

So basically if I have a firstname of steve in the database, and I type "s" in the textbox I would return the "teve",  my problem is I need to select only the "teve" text so that the user can keep typing, any ideas?
0
Comment
Question by:tentavarious
  • 2
  • 2
  • 2
6 Comments
 
LVL 9

Expert Comment

by:peterdungan
ID: 17890260
why don't you use the autocomplete extender?
0
 

Author Comment

by:tentavarious
ID: 17890511
I have never heard of it, is it a asp.net control?  Will it work with asp.net 1.1?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17891094
You can get it from the July CTP on the atlas.asp.net site. It's been pulled from the Beta for support reasons (MS are cuttiong back atlas to a supportable size prior to release) but it works fine. I think it will work with 1.1 as it really just javascript talking to a web service.
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 9

Accepted Solution

by:
peterdungan earned 250 total points
ID: 17891111
atlas.asp.net is now http://ajax.asp.net
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17945630
What the F*%$. Why did peterdungan get the points?

Type in atlas.asp.net and it is redirected to http://ajax.asp.net anyway. It was my answer that tell you why  simply gouing to http://ajax.asp.net is not good enought. You have to get the July CTP.



 
0
 

Author Comment

by:tentavarious
ID: 17950110
I guess because i will be using the autocomplete extender which was his idea.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question