Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 9th, 2006, 08:24 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default new window

Hei!

How do I make the "url" open up in its own window? Do I need to redirect to a new .asp and JS it?

Select Case Request.querystring("admin")
   Case "tilgang"
        Response.redirect "gi_tilgang.asp"
   Case "konto"
        "url"
   Case Else
        Response.redirect "abandon.asp"
End Select

Mvh
grstad
__________________
Internet has become favorable with that tool...thank you Tim Berners-Lee!
 
Old December 10th, 2006, 06:33 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

use the target property inside your anchor tag:
<a href="someLocation/pageName.asp" target="_blank">Link Text</a>

Wind is your friend
Matt
 
Old December 11th, 2006, 02:52 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...but it is a submit-button, not an a...

Mvh grstad
 
Old December 11th, 2006, 03:19 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by grstad
 ...but it is a submit-button, not an a...

Mvh grstad
You need to put it into client side script (usually Javascript), not your server side asp code (since that would be too late, so to speak).

You don't need to redirect it to a new .asp, necessarily. Whatever page you want to open in a new window - it can be the same page or a different page, or a different site, for that matter.

Here is a simple example:

Code:
<input type='submit' onClick="window.open('linktest.html','myWindow');" value="Open Window" />
Woody Z
http://www.learntoprogramnow.com
 
Old December 12th, 2006, 04:49 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...when one of the option-buttons (radio) is checked, the submit-button triggers the response-page, which says;

Select Case Request.Querystring("radio")
   Case konto
  (please open up an url in a new window)
   Case Else
      Response.redirect "some.asp"
End Select

How can I use "window.open('linktest.html','myWindow');" value="Open Window" /> here...?

Mvh
grstad
 
Old December 12th, 2006, 05:18 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You could write a Javascript function that, when the submit button is pressed, it could search through your form and detect which radio button was checked and then open a window based upon that.

Server side you could do something like:

Dim sJavaScript

Select Case Request.QueryString("radio")
   Case "konto"
      sJavaScript = "<script language=javascript>"
      sJavaScript = "window.open('yourpage.asp','windowname');"
      sJavaScript = "</scr" & "ipt>"
   Case "konto2"
      sJavaScript = "<script language=javascript>"
      sJavaScript = "window.open('yourpage2.asp','windowname');"
      sJavaScript = "</scr" & "ipt>"
   Case Else
      Response.Redirect("./some.asp")
End Select

Response.Write(sJavaScript)

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 12th, 2006, 05:49 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

...thank you sir. But why is "</script>" turned into "</scr" & "ipt>"...?

Mvh
grstad
 
Old December 12th, 2006, 07:21 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

mmmm good question.

You may want to add other properties to your .open method - x and y location of the window, height, width, re-size, scroll, tools etc. Go to:
http://msdn.microsoft.com/library/de...ods/open_0.asp
for all the options

Wind is your friend
Matt
 
Old December 13th, 2006, 09:35 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

In .NET if i were to send that code back to the browser, while it is syntactly correct, the browser will say that there is an error in the script.

Nearest I can tell it has to do with the JavaScripts that handle ViewState and Postbacks; I was able to get around this problem by changing the closing tag to how it is displayed above. So, to answer your question, I wrote it like that out of force of habit! =]

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 13th, 2006, 06:13 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

very interesting, thankyou for the explanation. In my experience, here in aussie, .net did not take over like I believe it has in other places. I have zero experience with it, however thought standardization was one of its benefits, sounds a bit hairy..:o)



Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing parent window from child window arnabghosh Javascript How-To 1 December 26th, 2007 01:18 AM
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
closed parent window when opened child window jaiwin Javascript How-To 0 October 8th, 2006 12:54 PM
Close Parent window on opening child window pkdev Javascript How-To 8 April 11th, 2004 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.