Why Join
Become a member
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
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
Gcobani Mkontwana
1.1k
1.1k
77.4k
Email invoice functionality and Continue shopping in mvc asp.net 5
Nov 25 2020 6:27 AM
Hi Team
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();
//create a new html document.
frameDoc.document.write(
'<html><head><title>DIV Contents</title>'
);
frameDoc.document.write(
'</head><body>'
);
// append external css file.
frameDoc.document.write(
'<link href="style.css" rel="stylesheet" type="text/css" />'
);
// append the div contents.
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>
// Model
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
; }
}
// Controller
public
ActionResult eNtsaPaymentOrders()
{
return
View((List<TrainingAcademy_Courses>)Session[
"cart"
]);
}
Reply
Answers (
2
)
How to reduce layout in bootstrap?
create a 4x4 layout using HTML,CSS