TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Yogesh Ghorpade
NA
762
148.1k
How To Call On Click Event Using J Query In MVC Application
Mar 15 2018 6:13 AM
How To Call Controllers Method Using J Query
I Have Tried This Code
View
<script>
function wronguser() {
debugger;
var obj = {};
$.ajax({
async: false,
type: "POST",
url: "Login/Cancel",
data: JSON.stringify(obj),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
debugger;
alert("Success");
},
error: function () {
alert("Failed to load ...!!!");
}
});
}
</script>
<input type="submit" value="Cancel" onclick="wronguser()" class="animated infinite pulse" style="background-color:#FFD540" />
Controller
[HttpPost]
public ActionResult Cancel()
{
return RedirectToAction("PageTwo", "MainPage");
}
Reply
Answers (
2
)
slidingExpiration is not working when sessionstate timeout
Which SQL server is best compatible with VS 2015. ?