473,473 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Open another browser during processing

If anyone knows how I could go about doing the following, I would
greatly appreciate some info.

I have an aspx page that has some fields for user input as well as a
button. When the button is clicked, the data that was entered by the
user is saved to the database. If the save is completed sucessfully,
the user would like to have a seperate browser window open and display
a receipt. This window will also have to have a print and a close
button.

The data is being saved in the clicked event of the button in the
aspx.vb page.

I've tried using a modaldialog, but it would not allow the print
function to be used.

Im not really sure how to go about using the
Page.RegisterStartupScript method. Ive tried to use it and I think
that my syntax is correct, I just dont know where to use it (Clicked
event, page load etc.)
Nov 19 '05 #1
3 1136
You can print from a modal dialog if you place an html button an do
window.print() in onclick event handler. The only thing you can't get is
print preview.

Eliyahu

"Lisa" <li**********@gnb.ca> wrote in message
news:fd**************************@posting.google.c om...
If anyone knows how I could go about doing the following, I would
greatly appreciate some info.

I have an aspx page that has some fields for user input as well as a
button. When the button is clicked, the data that was entered by the
user is saved to the database. If the save is completed sucessfully,
the user would like to have a seperate browser window open and display
a receipt. This window will also have to have a print and a close
button.

The data is being saved in the clicked event of the button in the
aspx.vb page.

I've tried using a modaldialog, but it would not allow the print
function to be used.

Im not really sure how to go about using the
Page.RegisterStartupScript method. Ive tried to use it and I think
that my syntax is correct, I just dont know where to use it (Clicked
event, page load etc.)

Nov 19 '05 #2
Ive actually tried that and it didn't work at all.

<INPUT id="cmdPrint" type="button" value="Print"
onclick="window.print();">

it does not seem to work. When I click the print button, nothing
happens.

I have also tried the following:

object in HTML:

<asp:Button id="cmdPrint" runat="server" Text="Print">

Code in page behind:

Private Sub cmdPrint_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdPrint.Click
Dim strScript As String
strScript = "<script language='javascript'>"
strScript += "window.print();"
strScript += "</script>"

Page.RegisterStartupScript("print", strScript)

End Sub

This works on my local PC, but not on our server. I thought that it
might have something to do with McAfee, so I asked if it could be
turned off. It didn't make any difference.

Nov 19 '05 #3
Strange. onclick="window.print(); should do. Just rechecked it again. May be
you are having security problems?

Eliyahu

<li**********@gnb.ca> wrote in message
news:11*********************@c13g2000cwb.googlegro ups.com...
Ive actually tried that and it didn't work at all.

<INPUT id="cmdPrint" type="button" value="Print"
onclick="window.print();">

it does not seem to work. When I click the print button, nothing
happens.

I have also tried the following:

object in HTML:

<asp:Button id="cmdPrint" runat="server" Text="Print">

Code in page behind:

Private Sub cmdPrint_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdPrint.Click
Dim strScript As String
strScript = "<script language='javascript'>"
strScript += "window.print();"
strScript += "</script>"

Page.RegisterStartupScript("print", strScript)

End Sub

This works on my local PC, but not on our server. I thought that it
might have something to do with McAfee, so I asked if it could be
turned off. It didn't make any difference.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#"...
10
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
2
by: Jason Morehouse | last post by:
Hello, Anyone know if it's possible to speak with the server via xmlhttp.open while the browser is doing a post -- file upload in this case: <form enctype="multipart/form-data"...
11
by: sri_san | last post by:
Hello, I am working on a page where I need to open a new webpage on a button click. I tried using javascript's window.open but with popup blocker enabled, it doesnt seem to work. Any way to get...
15
by: tshad | last post by:
I was looking for a way to handle refreshes (user pressed refresh button) and found a piece of code to check if a Web page was refreshed but I can't get it to work. The code is:...
5
by: nashak | last post by:
Hello, I have a aspx page on which I have a button. In the click event method in code-behind I do some processing and now need to open a new window in another browser and pass a couple of...
1
by: nashak | last post by:
Hello, I have a aspx page on which I have a button. In the click event method in code-behind I do some processing and now need to open a new window in another browser and pass a couple of...
6
by: Ros | last post by:
There are 10 files in the folder. I wish to process all the files one by one. But if the files are open or some processing is going on them then I do not want to disturb that process. In that case...
2
by: saggydel | last post by:
I have 3 web application these all are independent to each other. 1 web application have .aspx, .aspx.cs, web.config, .dll and some other Supporting files. I want to make a common setup of all 3...
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,...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.