TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
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
Forums
Monthly Leaders
Forum guidelines
chiranjeevi mugibari
1.5k
230
8.5k
pass parameter to javascript function
Sep 1 2016 9:28 AM
how to pass parameter from aspx.cs page to java script function
htmlbutton.Append("<table width='100%' cellpadding='2' cellspacing='2'><tr><td align='center'><input type='button' id='btnPrint' class='btn btn-theme' onclick='PrintDiv();' value='Print' /></td></tr></table>");
htmlTablenew.Append(htmlbutton.ToString() + "<hr>");
htmlbutton.Clear();
javascript function
<script type="text/javascript">
function PrintDiv() {
var contents = document.getElementById("tdi").innerHTML;
var frame1 = document.createElement('iframe');
frame1.name = "frame1";
frame1.style.position = "absolute";
frame1.style.top = "-1000000px";
document.body.appendChild(frame1);
var frameDoc = frame1.contentWindow ? frame1.contentWindow : frame1.contentDocument.document ? frame1.contentDocument.document : frame1.contentDocument;
frameDoc.document.open();
frameDoc.document.write('<html><head><title>DTM</title>');
frameDoc.document.write('</head><body>');
frameDoc.document.write(contents);
frameDoc.document.write('</body></html>');
frameDoc.document.close();
setTimeout(function () {
window.frames["frame1"].focus();
window.frames["frame1"].print();
document.body.removeChild(frame1);
}, 500);
return false;
}
</script>
Reply
Answers (
4
)
Development or further studies?
Why SQL server used with ASP.NET mostly