Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- //Url should contain the method you want to run
- url: "/api/ApiTest",
- //Method will be one of the REST API verb
- method: "POST",
- //These are all the parameters to be passed to method for rest api
- data:viewModel,
- dataType: 'json',
- success: function (data) {
- var bookingIDParam = data.Booking.BookingID
- window.location.href = '@Url.Action("BookingInfo", "Booking", new { BookingID = bookingIDParam })';
- },
- error: function () {
- alert("Error occured!!")
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement