Skip to content

Instantly share code, notes, and snippets.

@mrkacan
Created April 20, 2018 07:29
Show Gist options
  • Save mrkacan/4c32a2ec128963f6c708eb2862e5ed78 to your computer and use it in GitHub Desktop.
Save mrkacan/4c32a2ec128963f6c708eb2862e5ed78 to your computer and use it in GitHub Desktop.
C# MVC Ajax post to controller (ASP .NET MVC)
$.ajax({
cache: false,
url: "YOUR_CONTROLLER_NAME/ACTION_NAME",
data: { data: YOUR_DATA },
type: 'post',
success: () => {
//Do something for success;
},
complete: () => {
//Do something for complete;
},
error: () => {
//Do something for error;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment