DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: New Window with Response Redirect???

  1. #1
    Join Date
    Mar 2004
    Posts
    72

    New Window with Response Redirect???

    How can I modify this line of code to make the search.html file popup in a new window?

    Response.Redirect("search.html");

    I would like this file to open in a new browser window, leaving our site up in the background.

    Thanks,

    Alex Banks

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You cannot make that line of code open a new window. Response.Redirect runs on the server; you must use client-side JavaScript to open a window.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Mar 2004
    Posts
    72
    I currently have the function running on the client side, but the Windows XP pop-up blocker really confuses a lot of users and they cannot see the link.

    Is there any way to do it using meta tags or by refreshing the page?

    -Alex

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Windows XP's popup blocker will prevent any popup window unless it's opened by a direct user action (i.e., clicking a link that opens the window). You'll have to use a link that does a JavaScript window.open, or an href with target = "_blank".
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Jan 2006
    Location
    Oxfordshire
    Posts
    1
    Quote Originally Posted by hoyaabanks
    How can I modify this line of code to make the search.html file popup in a new window?

    Response.Redirect("search.html");

    I would like this file to open in a new browser window, leaving our site up in the background.

    Thanks,

    Alex Banks
    Hey Alex,

    Had a similar problem myself with an ad rotator. Not sure if its exactly going to be of any help, but just in case anyone else has trouble with new windows and the ad rotator - don't write out javascript, use this.

    adrotator.TargetFrame="target=_new"

  6. #6
    Join Date
    Feb 2006
    Posts
    1

    solution

    Quote Originally Posted by GripeMaster
    Hey Alex,

    Had a similar problem myself with an ad rotator. Not sure if its exactly going to be of any help, but just in case anyone else has trouble with new windows and the ad rotator - don't write out javascript, use this.

    adrotator.TargetFrame="target=_new"
    you try for this way


    this in .net only

    response.write("<script>");
    response.write("window.open('page.html','_blank')");
    response.write("</script>");

  7. #7
    Join Date
    May 2006
    Posts
    64
    May have problem with IE 7

    ===============

    http://www.programmingknowledge.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center