Guest User

Untitled

a guest
Feb 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <div id="product-pop-up" style="display: none; width: 700px;">
  2. <div class="product-page product-pop-up">
  3. <div class="row" id="modalBody">
  4.  
  5. </div>
  6. </div>
  7. </div>
  8.  
  9. $(".button-first-view").click(function () {
  10. var productId = $(this).data("id");
  11. $.ajax
  12. ({
  13. url: "/Product/FastViewProduct",
  14. data: { "productId": productId },
  15. contentType: "application/html; charset=utf-8",
  16. type: "GET",
  17. cache: !0,
  18. datatype: "html",
  19. success: function (t) {
  20. $("#modalBody").html(t);
  21. },
  22. error: function () {
  23. $("#modalBody").html("some things wrong");
  24. }
  25. });
  26. });
  27.  
  28. public async Task<ActionResult> FastViewProduct(int productId)
  29. {
  30. var quickView = await _objProductDal.GetProductForQuickView(productId);
  31.  
  32. if (quickView.ProductName == null)
  33. {
  34. ViewBag.ErrorMessage = "Something wrong, No product Found";
  35. }
  36.  
  37. return PartialView("_FastViewProductPartial", quickView);
  38. }
Add Comment
Please, Sign In to add comment