473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 3819


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bjoern Obermeyer | last post by:
Hi, I am writing an application with a JFrame as the main window and several dialogs to gain user input. The problem arises when another window (from a differnent apllication) hides my...
3
by: Rod | last post by:
I have an asp.net application where some of the interaction with the user is through modal dialog windows. This works very well except for the annoying fact that the dialog window always returns...
3
by: Andrew Baker | last post by:
OK this has me perplexed, puzzled and bamboozled! I have a remoting service which I displayed a message box in. I then wondered what would happen if a client made a call to the service while the...
2
by: cassidyc | last post by:
Hi, I was wondering if anyone has come accross this issue? And if they have any solutions I have that can create new copies of itself Form1 as = new form1(); af.show(); This form can also...
2
by: Ricky K. Rasmussen | last post by:
Hi NG, We have a rather large ASP.NET application that uses popups to display various dialogs to the user. In our work we've come over a rather annoying "bug": If we open a modal dialog using...
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
6
by: Lisa | last post by:
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 +=...
1
by: wendy | last post by:
I have got a problem while using the modal dialogs. In my code I need to open a modal dialog from the parent page and I need to enter some values in the dialog and save it. It takes the values...
2
by: sthrudel | last post by:
Hi! I'm working on a web application in Asp.net and what I would like to have is a cross borwser modal dialog which accepts user's input. I would like to catch what the user clicked on the...
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.