asp.net mvc - jQuery Autocomplete not working with Json data -


There is a whole bunch of tutorials on how to do this, examples and

Looks like real easy?

Example: The following tasks are quite fine

  public function searchstuff (string quo) {return content ("test"); } $ ('# MyTextBox'). Autocomplete ("MyController / FindStuff", {parse: function (data) {warning ('parsing');}});  

If I change it in the following, then nothing happens at all.

  Public Jason Oscald Fastf (String Q) {Jason (new {name = "test"}); } $ ('# MyTextBox'). Autocomplete ("MyController / FindStuff", {dataType: 'json', // I have also tried this line with the parse comment: function (data) {warning ('parsing');}});  

It seems that parsing calls can never be hit, that is, I'm assuming that the data load is flowing in some way or thinks that there is no data. any idea? Thank you.

P. s. This is the JaegerFeafer plugin.

Ensure that you are returning an array and you grant permission to receive the request (if you If ASP.NET is using MVC 2.0):

  public action results searchstuff (string queue) {jason (new [] {new} {name = "test"}}, jason fellow human beaver .); }  

and then follow the examples:

  $ ('# MyTextBox'). Autocomplete ("MyController / FindStuff", {dataType: 'json', pars: function (data) {var rows = new array (;; var i = 0; i & lt; data; langt; i ++ ) {Rows [i] = {data: data [i], value: data [i] .name}}} Return lines;}, formatItem: function (line, i, n) {return row.name;}}) ;  

Works well.

Note: It helps you diagnose problems quickly because it shows you why AJAX requests are being sent and why they are successful or unsuccessful.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -