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 :: how to validate the textbox using jquery 
Javascript :: javascript regex check phone number 
Javascript :: on enter key press react js 
Javascript :: convert nodes to array javascript 
Javascript :: palindrome rearranging javascript 
Javascript :: loop through array backwards 
Javascript :: sort object by key value js 
Javascript :: replace text in string in javascript 
Javascript :: what is ngmodel property binding 
Javascript :: https://mongoosejs.com/docs/deprecations.html#findandmodify 
Javascript :: object length javascript 
Javascript :: react native load function each time visit screen 
Javascript :: javascript average of arguments 
Javascript :: convert file to blob in angular 
Javascript :: To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. 
Javascript :: generate guard angular 
Javascript :: js onchange input value event listene 
Javascript :: jquery contains text 
Javascript :: regex pattern for strong password 
Javascript :: javascript calculate 24 hours ago 
Javascript :: url regex javascript 
Javascript :: for loop value index react 
Javascript :: js markdown to html 
Javascript :: javascript check how many times value in array 
Javascript :: referenceerror window is not defined ckeditor 
Javascript :: javascript regex replace 
Javascript :: iterate object in react 
Javascript :: `useFindAndModify` is an invalid option. 
Javascript :: remove # from url javascript 
Javascript :: rxjs map 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =