Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up without being called?

Status
Not open for further replies.

penguinspeaks

Technical User
Nov 13, 2002
234
0
16
US
I know this is not a ASP forum, but my question extends from that.
I have a page that is all ASP coding. This sends to another page in which a label is generated based on the asp and shown.

Is there a way to make this label page be a pop up with the parent being the ASP page?

When the codes execute on the ASP page, two things should happen. 1.)The label pops up to print 2.)The parent page goes to another page to await input.

Is this at all possible with JS?

 
The first part is entirely possible. You can build your label to print as a hidden div and show it with JS and using Ajax to call on the ASP page to generate the data required for the label.

The second part not so much. If the parent page changes, then the popup would need to exist on the destination page and be shown there. That is the popup is part of the existing page if it changes, the popup will go away with it.

In other words the page that will await input would be the one that holds the popup and shows it on arrival.

Now getting this flow to work is not easy or straight forward, as you will need to have several things interacting together, and understand how a ASP page works to deliver content, and how you can use that to build the popup. Either by having the ASP that produces the label data run on the final page, or using Ajax to to contact the ASP script and have it deliver its data back to the ajax call. And then have JS construct the label.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
I think I understand what you are saying here.
Ideally, the label would never actually be seen but only printed if hidden by the div. Correct?

The downside is you actually have to click print when the system printing screen opens. I do not think there is a way around this. I would love to have the label print when selection is made and the user would only hear the printer start.

What I have done in the mean time, is have the page print, but I put a delay that takes it back to the page printed from after 2 seconds. This was long enough for the page to render and the printing to take place. Once the user clicks print, they are already back on the page they were on.
 
This may or may not be relevant :-

There is the @screen, @print media types, where you can have CSS that is applied only when printing, so no need to change the page, draw the div with the desired printing output via AJAX and use CSS to control only that div as the printed output.




"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top