I need some help, i got two buttons that want to implement, on both View and Server side. I will share the code below on Javascript side and C#. Basically i want to create a functionality that will allow user to continue shopping and email button will send invoice to a user.
- <!--javascript libraries-->
- <script type="text/javascript">
- $(function () {
- $("#btnEmail").click(function () {
- var contents = $("#dvContents").html();
- var frame1 = $('<iframe />');
- frame1[0].name = "frame1";
- frame1.css({ "position": "absolute", "top": "-1000000px" });
- $("body").append(frame1);
- var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
- frameDoc.document.open();
-
-
- frameDoc.document.write('<html><head><title>DIV Contents</title>');
- frameDoc.document.write('</head><body>');
-
-
- frameDoc.document.write('<link href="style.css" rel="stylesheet" type="text/css" />');
-
-
- frameDoc.document.write(contents);
- frameDoc.document.write('</body></html>');
- frameDoc.document.close();
- setTimeout(function () {
- windows.frames["frame1"].focus();
- windows.frames["frame1"].print();
- frame1.remove();
- }, 500);
- });
- });
- </script>
-
- <button type="button" id="btnPrint" class="btn btn-primary">Email</button>
- <button type="button" class="btn btn-success">Continue Shopping</button>
- <button type="button" class="btn btn-warning">Place Order</button>
-
-
- public class TrainingAcademy_Courses
- {
- public int ? CourseNo { get; set; }
- public double Price { get; set; }
- public string Venue { get; set; }
- public string CourseDetails { get; set; }
- public string Url { get; set; }
- public string ZoomUrl { get; set; }
- public string CourseInstructor { get; set; }
- }
-
- public ActionResult eNtsaPaymentOrders()
- {
- return View((List<TrainingAcademy_Courses>)Session["cart"]);
- }