Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. $.ajax({
  2. //Url should contain the method you want to run
  3. url: "/api/ApiTest",
  4. //Method will be one of the REST API verb
  5. method: "POST",
  6. //These are all the parameters to be passed to method for rest api
  7. data:viewModel,
  8. dataType: 'json',
  9. success: function (data) {
  10. var bookingIDParam = data.Booking.BookingID
  11. window.location.href = '@Url.Action("BookingInfo", "Booking", new { BookingID = bookingIDParam })';
  12. },
  13. error: function () {
  14. alert("Error occured!!")
  15. }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement