Print Page

  • Thread starter Thread starter ruca
  • Start date Start date
R

ruca

How can I print my Page?

I have a button (named Print), that when clicked I want that he prints my
ASPX Page.


Ruca
 
Don't work (unless I have to import something)
Remember that I'm using VB language.

Ruca
 
Put a link on your page like this:

<a href=javascript:void(0);" onclick="javascript:window.print();">Print</a>

What Curt was saying is to use it in javascript. This has nothing to do with
VB.

-Stanley
 
no, this is a CLIENTSIDE call, from javascript.
There is no Serverside call to get the page to print on the client

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
 
You may be using VB for your server-side code, but I think what Curt was
trying to say is that doesn't matter, because the command to print a page
has to be executed on the client (browser), not in any server-side asp.net
code. You will have to manually enter the code in your html source.

For example:

<button onclick="window.print();">Print me</button>

Ray at home
 
Ok, I already understand. Sorry the confusion.
If I want to use with a button, it must be HTML type button and not Web
Forms type, right???
With HTML type it's already working


Thank you guys for your help.
Ruca
 
You can use web forms buttons you just have to add an attribute in your
Page_Load method.

-Stanley
 
the MSDN web pages have a "Page Options-->Print this page" that formats the page before calling "Window.Print", any idea on what they do?
 
Back
Top