0

can anyone tell me what code should i use to print when i click the button it'll automatically print the page? or any other suggestion?

3
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by patelriki13
0

can you explain for me further..i cannot get it from there..

0

Ok, basically, what I'm finding when I look at print options for web applications is this...

1) It's not a code-behind process, it's a user-end process
2) It can be accomplished using JavaScript or other browser-level scripting

A simple method to invoke a 'print-screen' type scenario would be the JavaScript function of

window.print()

Which will call the page print function. Beyond that, if you want to add additional print functionality (page layout, etc) you would need to look into other JavaScript or possibly ActiveX controls of some sort to implement those functions.

Hope that helps :) Please remember to mark as solved once your issue is resolved.

P.s.: The above information was from the first non-advertising link in the search I posted to you earlier... Please try to perform basic research before asking others to do your work for you in the forums :twisted:

0

firest create java script

<script type="text/javascript">
function printfn()
{
	document.getElementById('1001a1').innerHTML='';
	if(document.getElementById('down-time')!=null)
		document.getElementById('down-time').style.display='none';	
		cancelfn()
	window.print();
}
function cancelfn()
{
	document.getElementById('1001a2').innerHTML='';
	if(document.getElementById('down-time')!=null)
		document.getElementById('down-time').style.display='none';	
}
</script>

than write code in aspx file like this ....

<td align="center" valign="top" ><span id="1001a1">To Print Click Heare <a href="PrintPage.aspx" onclick="javascript:printfn();">(Print)</a></span></td>
                        <td align="center" valign="top"><span id="1001a2">To Cancel Click Heare<a href="CancelthanGoToPage.aspx" onclick="javascript:cancelfn();">(Cancel)</a></span></td>

and enjoy it.....


OR

Download Sample

http://www.mediafire.com/file/217g50uv7cf2lf6/Print Page Simple Way.rar
Patel Rikin
patelriki13@gmail.com

Edited by patelriki13: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.