c# - Save data to DB using JQuery ajax on button click -


here jquery ajax method:

 $(document).ready(function () {      $("input[id$='btnbulten']").click(function () {         //alert("dd");         $.ajax({             type: "post",             url: "http://url/controls/ebulten.ascx/ebultensend",             contenttype: "application/json; charset=utf-8",             data: "{namesurname:" + $("input['id$='$txtnamesurname']").val() + " }",             datatype: "json",             success: function (msg) {                 alert("mesajınız başarıyla iletildi");             }         });     }); }); 

and in codebehind code:

 [webmethod()] public static void ebultensend(string namesurname, string email, string ip, string position, string firmname) {     int bultenid = ebulten.insertebulten(namesurname, email, ip, position, firmname); } 

insertebulten calling sp save data db. parameters comes textboxes. not able save data database.how can fix this? normally, without webmethod, if use method on client click, inserts data db.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -