[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1198
  • Last Modified:

Open New Window AND Redirect

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
APD Toronto
Asked:
APD Toronto
  • 4
  • 3
1 Solution
 
Scott Fell, EE MVEDeveloperCommented:
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
 
APD TorontoAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
APD TorontoAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
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
 
APD TorontoAuthor Commented:
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
 
APD TorontoAuthor Commented:
Thanks, I ended up using an iFrame.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now