469,323 Members | 1,667 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Printing from Modal Dialogs

I have an aspx page that has a print button on it. The code for the
clicked event of the print button is:

Dim strScript As String
strScript = "<script language='javascript'>"
strScript += "window.print;"
strScript += "</script>"
Page.RegisterStartUpScript("pirnt", strScript)

The aspx page above is opened using the following code from another
aspx page:

strScript = "var windowOptions = 'dialogHeight: 400px; dialogWidth:
600px;
center: yes; help: no; resizable: no; status: no;'; "
strScript += "window.showModalDialog(Page1.aspx, null,
windowOptions);"

Page.RegisterStartUpScript("SucessScript", "<script
language='javascript'>" + strScript + "</script>")

When compiled and ran locally, the print button will envoke the Print
dialog. If I compile the same code and run it from my server the
button does nothing. Anyone know why and what I can do to fix this?

It works in both places when it is not a modal dialog.
Jul 23 '05 #1
2 3732


Lisa wrote:
I have an aspx page that has a print button on it. The code for the
clicked event of the print button is:

Dim strScript As String
strScript = "<script language='javascript'>"
strScript += "window.print;"


That should be
strScript += "window.print();"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen wrote:


Lisa wrote:
I have an aspx page that has a print button on it. The code for the
clicked event of the print button is:

Dim strScript As String
strScript = "<script language='javascript'>"
strScript += "window.print;"

That should be
strScript += "window.print();"


It should also be:

strScript = "<script type='text/javascript'>"

--
Rob
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bjoern Obermeyer | last post: by
2 posts views Thread by cassidyc | last post: by
2 posts views Thread by Ricky K. Rasmussen | last post: by
10 posts views Thread by Guadala Harry | last post: by
6 posts views Thread by Lisa | last post: by
1 post views Thread by wendy | last post: by
2 posts views Thread by sthrudel | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.