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 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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.