I don't believe there is. Methods like the window.print() method simply
trigger the browser's print method, in other words, calling window.print()
is simply an indirect method to the browser, so whether a dialog shows up or
not is dependent on the browser (and maybe it's settings, if applicable),
not your code. I believe this is a security related thing (so that nobody
makes a web page that sends a thousand unwanted pages to your printer or
something) as well as something to make code more cross-browser compatible.
If you were simply looking to have the print settings set to certain
settings, you could do something like have the button pop up an
window.alert() asking the user to change their print settings before it
calls the window.print(). Hopefully this clears things up, and maybe gives
you a few ideas to accomplish what you were looking to do.
--
Nathan Sokalski
nj********@hotmail.com http://www.nathansokalski.com/
"John Peterson" <j0***@comcast.net> wrote in message
news:un*************@TK2MSFTNGP14.phx.gbl...
Hello all!
I'm at my wits end trying to search for what I assumed to be a relatively
straightforward task. I have a Web application written in C#, and I have
a button on the form that I want to print the current contents of the
browser without bringing up the print dialog.
At first I thought it was a simple matter to have the button's "onclick"
attribute set to "window.print();". However, that always brings up the
print dialog box. There doesn't seem to be any parameters to
window.print() to suppress the dialog and just use the defaults.
In essence, I'd like to mimic the behavior of the browser's (IE, in my
case) behavior when the print button is clicked.
Is there any way to do this?
Thanks!
John Peterson