What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 41973 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > Intellisense in Text box ...
Toashish80

Intellisense in Text box

Replies: 5 | Posted by: Toashish80 on 4/21/2010 | Category: ASP.NET Forums | Views: 2687 | Status: [Member]  


I have a text box which will be used for entering some alphanumeric value. I want to buid intellisense in the text box such that when user enters some value then based on the options available from the database it should display a list of options from where user can choose.


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Muhilan
Muhilan  
Posted on: 4/21/2010 12:38:41 AM
Level: Starter | Status: [Member]

use Ajax Auto Complete Control for your requirement,want to know more about auto complete control go through the link http://www.asp.net/ajaxlibrary/act_AutoComplete.ashx

Toashish80, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muhilan
Muhilan  
Posted on: 4/21/2010 12:42:08 AM
Level: Starter | Status: [Member]

see this also http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AutoComplete/AutoComplete.aspx

Toashish80, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Toashish80
Toashish80  
Posted on: 4/21/2010 1:27:23 AM
Level: Starter | Status: [Member]

I tried using the same. I have taken the service method path as the aspx name. In the public function I am returning 2 strings.
When I am building the application and entering the first 2 characters its not giving me any popup. Can you provide some sample code for the Service Method.

Toashish80, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muhilan
Muhilan  
Posted on: 4/21/2010 1:44:17 AM
Level: Starter | Status: [Member]

create webservice for your DB

ex..


[WebMethod]
public string[] Information(string prefixText)
{
int count = 10;
string sql = "Select * from t.b Where column_Name like @prefixText";
SqlDataAdapter da = new SqlDataAdapter(sql,"Your Connection String Comes Here"));
da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText+ "%";
DataTable dt = new DataTable();
da.Fill(dt);
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr["Country_Name"].ToString(),i);
i++;
}
return items;
}


call the above webservice method in extender method

ServicePath="WebService.asmx"

ex..

<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1" ServiceMethod="Information" ServicePath="WebService.asmx" TargetControlID="TextBox1"> </cc1:AutoCompleteExtender>

Toashish80, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Santosh4u
Santosh4u  
Posted on: 9/14/2010 5:15:32 AM
Level: Bronze | Status: [Member] | Points: 25

hi
if windows application then follow below link...

http://santoshdotnetarena.blogspot.com/2009/10/in.html


Regards
Santosh

Toashish80, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 10:24:39 AM