Error on $.ajax: 500 internal server
I don't know what is wrong in my code here, but I receive this error.
My code:
- $("#_butt").click(function () {
- //alert($("input:text").length);
- $('#table input[type="text"]').each(function () {
- $.ajax({
- type: "POST",
- url: "WebService.asmx/gotodb",
- data: "{str1:'" + $(this).val() + "'}",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (msg) {
- alert(msg.d);
- }
- });
- });
- });
Services.cs
- [WebMethod]
- public string gotodb(string str1)
- {
- return "just a test";
- }
I need to use the web-service to add values of the text boxes into my database.
Thanks. I forgot to uncomment a line!