Text Multisearch in ASP.NET

I need to make text-text-text-text-text-text-ASP.NET (C #) (i.e. let me select and enter 3 values ​​like that: "one, two, three") autocomplete with a suggestion such as Google Search in my database , and in the meantime, entering a value into the text of the datagrid will show the data available in our database ... Do you have any tips or ideas to do it right?

Thank you very much for your attention

Greetings

Edited by:

I am trying to do this using C # and not jquery as requested, not jquery.

Many thanks.

+4
source share
10 answers

You can use the jQuery UI AutoComplete functionality:

http://jqueryui.com/demos/autocomplete/#multiple

+5
source

For the autocomplete part, you will need the AJAX Control Toolkit AutoCompleteExtender : http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx

And for the search part, you will need SQL Server Full Text Search : http://blog.sqlauthority.com/2008/09/05/sql-server-creating-full-text-catalog-and-index/

+1
source

You can check out http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/autocomplete/autocomplete.aspx , which supports coma search.

It takes time to load the list, but it loads the list.

You can even try http://pholpar.wordpress.com/2010/02/25/multivalue-autocomplete-winforms-textbox-for-tagging/ the sample for Winform should have converted to Webform.

Happy coding !!!

+1
source

You can use the AjaxToolKit AutoFill Extender .

You will definitely get the answer to your question.

+1
source

Since you do not want to use jQuery, I would recommend the AJAX AutoFill Extender. Really useful, and you can execute all your request code in C # using the web method. Check out the article here.

0
source

Text box, ajax toolkit AutoComp xtender will do this for you. For this:

  • Create a WebMethod or Page method.
  • Call your selection request in this method.
  • Call this in the Ajax toolkit Autocomplete Extender using the ToolkitScriptmanager.

The above is just to show you the way out, the relaxation you get from Google. http://www.aspdotnet-suresh.com/2011/05/ajax-autocompleteextender-sample.html

0
source

You can use the AjaxToolKit AutoFill Extender.

Check out the following link. All resources in the following link. http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx

And this is a link to a sample project code

http://www.codeproject.com/Articles/201099/AutoComplete-With-DataBase-and-AjaxControlToolkit

0
source

Real quick - you need a "&" between your key / value pairs, so change to:

 Response.Redirect("~SearchResults.aspx?Weight=" + txtWeight.Text + "&Height=" + txtHeight.Text + "&Age=" + txtAge1.Text + txtAge2.Text + "&Country=" + ddlCountry.SelectedValue); 

As for your SearchResult.aspx, you need to get the values ​​using QueryString, something like:

 string Weight = Request.QueryString["Weight"]; string Height = Request.QueryString["Height"]; ...and so on. You use the key from the redirect and the value is returned (setting your string variables). 

As for your query, what are your tables and what exactly are you looking for in terms of results? I understand that you have these criteria, but you are looking for something, exactly what, what are these criteria? Or close? Hope this helps!

0
source

Sounds like a job to automatically complete jQuery and jqgrid to display the corresponding data.

You can never redirect because you want to stay on one page and just want to dynamically update parts of the page.

If you have the opportunity to use MVC 4, in particular, the WEB API, then it will be brilliant if you do not use a web method that accepts and returns json data.

http://www.asp.net/web-api

I personally will not use ajaxtoolkit for this, the closer your code is to HTML, the better you go.

0
source

Search for an autocomplete text field using a web method with a database search result.

  $(document).ready(function() { SearchText(); }); function SearchText() { $(".autosuggest").autocomplete({ source: function(request, response) { $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Default.aspx/GetAutoCompleteData", data: "{'username':'" + document.getElementById('txtSearch').value + "'}", dataType: "json", success: function(data) { response(data.d); }, error: function(result) { alert("Error"); } }); } }); } [WebMethod] public static List<string> GetAutoCompleteData(string username) { List<string> result = new List<string>(); using (SqlConnection con = new SqlConnection("Data Source=yourserver;Integrated Security=true;Initial Catalog=yourdatabase;User Id=youruserid;Password=yourpassword")) { using (SqlCommand cmd = new SqlCommand("select DISTINCT Name from Company where Name LIKE '%' +@SearchText +'%'", con)) { con.Open(); cmd.Parameters.AddWithValue("@SearchText", username); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { result.Add(dr["Name"].ToString()); } return result; } } } 

for more details http://www.infinetsoft.com/Post/How-to-create-autocomplete-textbox-with-database-in-asp-net-c/1254

0
source

Source: https://habr.com/ru/post/1414284/


All Articles