how to get suggestions in textbox while typing text - asp.net

I have text-box and grid-view is present in same asp.net page. while typing some text in text-box I want suggestions, if text is present in data grid-view.
Example: Google Suggest.
What will be the procedure to achieve this.

There are several ways to get this done.
Since you're using asp.net (if you're using webforms) you can use the ajax control toolkit which has a combobox control
http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/ComboBox/ComboBox.aspx
Or you can go with jquery ui
http://jqueryui.com/autocomplete/
There are many other plugins and frameworks you can try, but these two are pretty basic.

Related

Showing real time result in textbox in asp.net

I'm developing a website (ASP.net) which involves users typing in a textbox to search. I want to display result in the textbox as they are typing the keywords (just like when we are searching on Google).
How can I do this?
Thanks
What you ask is called autocomplete and since you are working on asp.net the most easy direct solution is the use of asp.net ajax control toolkit
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
How ever if you use some other javascript helper library, like jQuery, you can find a lot more examples, one of them : jQuery Autocomplete and ASP.NET
Also if you search for "autocomplete asp.net" you find more examples, some of them:
http://www.asp.net/ajaxlibrary/act_AutoComplete_Simple.ashx
http://www.codeproject.com/Articles/201099/AutoComplete-With-DataBase-and-AjaxControlToolkit

Paging in ASP.NET gridview

I am looking for paging in which I can enter values in a box to reach at desired page something like this.
I googled it. but could not find this. Help me if you have links or code.
I am working on asp.net 4.0.
Thanks
There's no out of the box functionality. To do that, you'd need to override the DataBound event of the gridview and add a custom pager row. This CodeProject tutorial or this article might get you started.
As told by Echilon i used CustomPager and used textbox instead of slider in it.

Validating a textbox with AJAX Toolkit in ASP.NET

I'm not really sure where or what to search for regarding the following question:
I have a TextBox control and a Label control on my page. I have a database query ready and I would like to run it on the TextBox textchanged event in order to display a "valid" or "not valid" text in the Label.
How can I achieve this without posting back the entire page on each textchanged event? I have installed the AJAX Control Toolkit and got the samples working but I don't seem to find an extender that would fit the bill. Any tips? Much appreciated, thank you.
Firstly, move away from the AjaxControlToolkit. This is for lazy web developers who dont know what they are doing.
Secondly, check out jQuery Ajax. Learn how to use it properly in order to do what you are needing to do.
Basically what you will need to do is post via jQuery Ajax to your page/webservice in order to run the database query. You can then return your data to the page and update the UI.
http://api.jquery.com/jQuery.ajax/

I want to make UI such as the select box + text box

Nice to meet you. I developed Windows application with VisualStudio so far.
It was these days and has begun to do the Web application.
Therefore there is a question, but will there be UI which added a select box and text box in HTML?
Though it can choose some choices, it is a thing to have the direct input if there does not have it.
It is the guy who seems to be the URL input area of a place saying in FireFox and IE.
A past history appears here with a list like a select box and can input it directly.
When there was such a demand, how should it have been settled?
Will it be a feeling to arrange a select box and text box?
If your using ASP.NET Ajax check out the AJAX Control Toolkit ("ACT"), it has a ComboBox control. Very easy to use and a demo online here.
What you need to learn about are ASP.NET User Controls; these are custom components wherein you can combine standard ASP.NET controls in one component and use them for your ASP.NET application.
Sounds like you want a ComboBox control, but is this for ASP.Net or Winforms?

Modifying <asp:label> in form

I am developing a form using all asp:textbox and asp:label. Currently, I am using the RequiredFieldValidator to validate text boxes and display an error inline. What I am trying to do is to change the color of one of the asp:labels after validation fails for one of the textboxes fields. Would I accomplish this with javascript, or is there any commands that can do it within asp to modify labels. I would really appreciate any help and code examples.
I'd say that javascript is the way forward here if you don't want to postback to the server. If you use ASP.NET only the page will normally have to be posted back so that the server can change the properties of the label - not very user friendly. A colleague of mine has accomplished this very nicely using JQuery (a javascript libraray) but unfortunatly I don't have a copy of the code to hand. He's an SO user too so I'll pass on a link to this post for you.

Resources