INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Pop up without being called?

Pop up without being called?

(OP)
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?

RE: Pop up without being called?

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

RE: Pop up without being called?

(OP)
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.

RE: Pop up without being called?

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.

http://www.w3schools.com/css/css_mediatypes.asp

"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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close