Although JustinStolle's answer solves your problem, I would draw attention to the error provided from the structure. Unless you have a good reason to send your data using the GET method, you should forward it using the POST method.
The fact is that when using the GET method, your parameters are added to the URL of your request instead of adding to the header / body of your request. This may seem like a tiny difference, but a mistake tells you why it matters. Proxies and other potential servers between the sender and the receiver tend to register the request URL and often ignore the headers and / or body of the request. This information is also often considered not important / secret, so any data displayed in the URL is less secure by default.
It is best to send your data using the POST method so that your data is added to the body instead of the URL. Fortunately, this is easy to change, especially since you are using jquery. You can use the $.post wrapper or add the type: "POST" to your parameters:
$.ajax({ url: "/Home/List", type: "POST", dataType: "json", data: { number: '1' }, success: function (data) { alert(data) }, error: function (xhr) { alert(xhr.status) } });
Per hornshΓΈj-schierbeck
source share