javascript - How can i call c# functions from JS? -
i have c# page 2 functions - 1 data mssql database, , second 1 insert data it.
i want know how use ajax (or other way?) call functions js file. 1 of functions need data back, other 1 need send data js c# functions..
i believe using jquery based on tags.
to send request in jquery:
$.get("myurl", function(data) { console.log(data); });
data
contains content of myurl - if content json, plainobject, if not string.
to send request parameters in jquery:
$.get("myurl", {"param1":"content","param2":"content"}, function(data) { console.log(data); });
to send post request in jquery:
$.post("myurl", {"param1":"content","param2":"content"}, function(data) { console.log(data); });
Comments
Post a Comment