Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to call a c# functio from Javascript

<script type="text/javascript">             //Default.aspx
   function DeleteKartItems() {     
         $.ajax({
         type: "POST",
         url: 'Default.aspx/DeleteItem',
         data: "",
         contentType: "application/json; charset=utf-8",
         dataType: "json",
         success: function (msg) {
             $("#divResult").html("success");
         },
         error: function (e) {
             $("#divResult").html("Something Wrong.");
         }
     });
   }
</script>

[WebMethod]                                 //Default.aspx.cs
public static void DeleteItem()
{
    //Your Logic
}
Comment

call c# function from javascript

Comment

PREVIOUS NEXT
Code Example
Javascript :: add 7 days in date using jquery 
Javascript :: svg react native 
Javascript :: disable a function javascript 
Javascript :: lottie npm 
Javascript :: sum of a sequence 
Javascript :: how to write unit test cases in react js 
Javascript :: javascript merge multidimensional array 
Javascript :: remove item from array 
Javascript :: javascript array looping 
Javascript :: socket io get user rooms 
Javascript :: axios remove existing token 
Javascript :: if page is loading then show loader in js 
Javascript :: post json array data curl 
Javascript :: array of array of string js 
Javascript :: fastify query 
Javascript :: discord.js embed 
Javascript :: automated email sending using node js server 
Javascript :: How to write a mutation observer js 
Javascript :: vue resources post 
Javascript :: JS copy image 
Javascript :: javascript afficher 
Javascript :: arithmetic expressions in scheme 
Javascript :: onClick button react send to another component 
Python :: python generate folder if it not exist 
Python :: get wd in python 
Python :: how to shutdown a computer with python 
Python :: conda requests 
Python :: how to print time python 3 
Python :: find time of run for python code 
Python :: tqdm pandas apply in notebook 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =