Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Open New Window AND Redirect

Posted on 2014-01-10
7
Medium Priority
?
1,142 Views
Last Modified: 2014-01-18
Hello Experts,

In Classic ASP, is it possible to open page1.asp in a new window (perhaps body onLoad=window.open('page1.asp', '_top') while load page2.asp in the parent window (perhaps Response.Redirect, or maybe I can add to my body onLoad)?

Thank you
0
Comment
Question by:APD_Toronto
  • 4
  • 3
7 Comments
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39772872
It is possible in client side javascript.  But whichever page is the pop up would probably be silently blocked or an alert.  

What is it you are trying to ultimately achieve.  Typically, when there is a question like this there is a different way to do the same thing you have not though of.
0
 

Author Comment

by:APD_Toronto
ID: 39773646
It won't be blocked as it's an Intranet site.  All permissions granted to popups.

It's just after an order is processed, I need a popup with the order summary, while in the parent window, return the employee to the new order screen.
0
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39773745
Pop ups are still not such a great idea.  They are hard to use.  Your choices are to


Option A Using all asp
1)  User on order.asp page and clicks a button to send order to order_process.asp
2) order_process.asp does all the work
3)  User sent to confirm.asp  (or combine with step2 and just use confirm.asp to do step 2
4) After confirm, send back to order.asp

Option B Using javascript/jquery ajax and an alert
1) User on order.asp page clicks a button
2) User stays on order.asp and sends an ajax request to order_process.asp
3) The status is returned from order_process and A Pop Up is created about the transaction.
4) User clicks out of Pop Up and is still on order.asp which refreshes and is ready for new


Option C Using javascript/jquery ajax with a pop up window
1) User on order.asp page clicks a button
2) User stays on order.asp and sends an ajax request to order_process.asp
3) The status is returned from order_process and an alert is created about the transaction.
4) User clicks button on pup up which closes and returns to order.asp.

Option D Using javascript/jquery ajax with a modal
1) User on order.asp page clicks a button
2) User stays on order.asp and sends an ajax request to order_process.asp
3) The status is returned from order_process and a modal is generated with the transaction.
4) User clicks out of modal and is still on order.asp which refreshes and is ready for new

Option D I think is  your best bet and will look good on mobile/tablet.  Option C is hardly ever used anymore and very difficult to maneuver.

Option D sample http://jsbin.com/EwOnILI/1/ and code
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
  
    <!-- Custom styles for this template -->
    <link href="http://getbootstrap.com/examples/jumbotron-narrow/jumbotron-narrow.css" rel="stylesheet">
  
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
   <div class="container">
      <div class="header">
        <ul class="nav nav-pills pull-right">
          <li class="active"><a href="#">Home</a></li>
          <li><a href="#">About</a></li>
          <li><a href="#">Contact</a></li>
        </ul>
        <h3 class="text-muted">Project name</h3>
      </div>

      <div class="jumbotron">
        <h1>Submit Your Order</h1>
        <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
        <div class="row">
        <input placeholder="Name">
        <input placeholder="Address">
        <input placeholder="Qty">
        <input placeholder="Product">
        </div>
        
        <p><a class="btn btn-lg btn-success" data-toggle="modal" data-target="#myModal">Submit Order</a></p>
      </div>

      <div class="row marketing">
        <div class="col-lg-6">
          <h4>Subheading</h4>
          <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

          <h4>Subheading</h4>
          <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p>

          <h4>Subheading</h4>
          <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
        </div>

        <div class="col-lg-6">
          <h4>Subheading</h4>
          <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>

        
        </div>
      </div>

      <div class="footer">
        <p>&copy; Company 2013</p>
      </div>
     
     
     <!-- modal -->
     
     <!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        You ordered a bunch of stuff.  Thank you!
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
     <!-- end modal -->

    </div> <!-- /container -->

</body>
</html>

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:APD_Toronto
ID: 39773890
The order page is at domain A, which submits to orderProcess at domain B, which then goes to receipt.asp also at domain B.  

I need the popup to start at orderProcess so it has the same session as receipt.

While, after submission the parent window goes to order-list.asp.

Please don't school me on popups are bad and I need to rewrite my system, blah, blah, because my answer to that is my client is barely paying me minimum wage.  

As my original question, I just need to know how I can do a popup of pageA.asp, while at the same time go to pageB.asp in the parent window?
0
 
LVL 54

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 total points
ID: 39773941
I understand.  

That sounds like we don't have to stay on domain A, right?  Just have the form action point to Domain B Process which triggers the pop up?

Just throwing out the idea of an iframe?

js popup window http://jsbin.com/aKebepI/1/
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body onload="myPopup2()">
  <script type="text/javascript">
<!--
function myPopup2() {
window.open( "http://www.google.com/", "myWindow", 
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>
  You should have a pop up when this loads
</body>
</html>

Open in new window

0
 

Author Comment

by:APD_Toronto
ID: 39773970
I will have some thought on the iFrame.

In the meanwhile, your code does the popup, but what about the subsequent re-direct? If it is to hard I may just do "click here to continue".
0
 

Author Closing Comment

by:APD_Toronto
ID: 39791130
Thanks, I ended up using an iFrame.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question