VB.NET - How to Print page with out url and page numbers
Asked By suha sini on 08-Sep-06 08:36 AM
hi,
my application is WEB application ,in that i am print one page using
onLoad="window.print()"
<body MS_POSITIONING="GridLayout" onLoad="window.print()">
it working Properly.
My problem is that in that page TOP and BOOTOM I am getting page Numbers And url address .
How to Print page with out url and page numbers
Sushila Patel replied to suha sini on 08-Sep-06 08:50 AM
Not sure of solution with Html/Javascript
You can check out some http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/printpreview/reference/behaviors/headerfooter.asp on msdn, working around with that would help
Code wise you can use Activex
or else give user a note saying
Go to File > Configure Page > Delete all the text in the heading and bottom sections
printing web page with out url
K Pravin Kumar Reddy replied to suha sini on 08-Sep-06 08:58 AM
hello
check the code
btn.Attributes.Add("onclick()","Javascript:window.print()");
put this code in page load
when u click on button it will ask u to select printer/print dialog box and press button thats it it will print with out url
How to Print page with out url and page numbers in ASP.NET C#
Divya Jain replied to suha sini on 22-Aug-08 07:45 AM
I am getting page Numbers And url address while printing page.
can u tell me how to print page without URL & Page numbers
10-Aug-13 06:40 PM if BODY tag contains onload = window.print() then a PrintDialog is displayed with the page on browser ahndler of the body tag by using BodyId.Attributes.Remove("onload"); but, in order to make this work, you got to control, you can not have a javascript method call in onload event. . . Please revert back with your actual requirement, so that body tag attributes in c# using if BODY tag contains onload = window.print() then a PrintDialog is displayed with the page on browser
a page <input type = "button" value = "Print this page" onClick = "window.print()"> But whats happening after print button i also coming. . I Page< / title > < script type = 'text / javascript' language = "javascript" > function printContent() { window.print(); } < / script > < / head > < body onload = "printContent();" > < form id = "form1" runat = "server" > < div > < / div > < / form > < / body value = " Print " ' ); pp.document.writeln( ' onclick = "javascript:location.reload(true);window. print ();"> ' ); pp.document.writeln( ' <INPUT ID = "CLOSE" type = "button" ' + ' value = "Close window.open( ”, ” ).document.write( divMyArea.innerHTML + ‘<input type = button onclick = "window.print();" value = Print> ‘ ); } Protected Sub PrintAllPages(ByVal sender As Object
textbox ? help. . . . (for c# asp.net) You can use javascript:window.print() in the onClick event of your "Print" button. <INPUT TYPE = "button" VALUE = "Print" ONCLICK = "javascript window.print()"> If you wish to ignore specific portions of the page focus in an appropriate event using Javascript like this: <body onload = "javascript:document.getElementById('empid').focus()"> I need the printing just they want. . .help. . . you need to execute the javascript function window.print() you can do this by doing btn.attributes.add("onClick", "window.print();") if it's a WebControls.Button, or simply using
can do this pls give me solution thanks simply call window.print javascript method to print a web page put a print button on page as follows <input type = "button" onclick = "window.print();" value = "print" runat = "server"> Hi The simpliest solution is to of that mypage.aspx to an iframe then on iframes onload event call the window.print. <button onclick = "printPage()" > print< / button> <div id = "printerDiv" style = "display div = document.getElementById( "printerDiv" ); div.innerHTML = '<iframe src = "mypage.aspx" onload = "this.contentWindow.print();"> < / iframe> ' ; } < / script> Untitled document < script type = "text
link rel = "alternate" media = "print" href = "Invoice_03012005_1657.pdf"> < / head> <body onload = "window.print()"> . . . < / body> < / html> If the document is placed in a directory
view data on a separate page when you can use window.print() javascript function for this. Write your function on .aspx page in the body tab. <body onload = "window.print()" the window.print() function will call the browsers print dialogue box and let
divGrid" ) divGrid.style.height = '100%' ; winprint.document.close(); winprint.focus(); window.print( "sWinHTML" ); } It works fine , the problem is when new preview com / articles / 20030627a.asp end of post you are calling window.print( "sWinHTML" ); from the ORIGINAL page. What you want to do is have the GENERATED PAGE call window.Print. so you can simply add the javascript printing instructions to the created page and have it's body onload event call this function. Change the last line to - winprint
print.css will take effect. HI you have to call window.print(); javascript on onclick event if you are using asp:button, asp:imagebutton, asp:linkbutton then OnClientClick = "window.print(); return false;" On Click of button on on page load write this code 1. Response.Write("<Script> window.print()< / Script> ") 2. For page break wirte below code on html com / KB / aspnet / PrintPreview.aspx In Javascript, simply call the window.print(); method on the client side. Printing the page on button
link on a page. Write the following: <a href = "javascript:window.print()"> Print Page< / a> When you click this link in your p> I get printed< / p> <form> <input type = "button" onclick = "window.print()" value = "Print" / > < / form> < / body> < / html> Hope this will help you and same time it will print then you just put window.print on page load of new window print page. eg suppose print button on abc.aspx page you