Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp code to call print dialog

Status
Not open for further replies.

Jahappz

Technical User
Jun 3, 2002
133
0
0
SE
Iam looking for asp code to call the printer dialog from a button in a website.
I want to save the post and then get the print dialog (CTRL+P)
Any one have a sample for that?
 
Do you want to make sure the command is done server-side in case the user disables javascript?

[monkey][snake] <.
 
Do you want to print the screen or something else?

If you want to print the screen then that must be done by the browser. ASP does not know, and does not try to know, the layout of the screen. ASP does produce the HTTP Response but it is only the browser that parses that into the DOM and displays it... As far as ASP is concerned it is just a bunch of data.

If you want something to print on the server-side the the best way to do this is have your ASP write the data to be printed into a row of the database table. Then write a separate prograrm a small .EXE that reads the database and prints any new rows. The EXE can be written as a service that polls the DB periodically or even easier would be to make it just as simple as possible and use the Windows Scheduler to fire it off ever X minutes. The program would start, check for prior instance of self, read new rows, print them and then close itself.
 
its just a page that lists a bunch of names with a button after that says "Sign in" and when the user push the button i want the print dialog with the users Name to be printed (name tag) and after that return to the list
 
If name tag comes out of the user's printer then you need to use browser-side JavaScript instead of ASP because ASP only controls what happens on the web server and the web server does not have any control over the user's printer. Only the user's browser can do that.


The JavaScript forum is here: forum216
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top