|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

March 16th, 2004, 03:42 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Response.redirect in new window
Hi
I have got a page that redirects users depending on their NT group memebership e.g
Case "Group A"
Response.redirect("Y.asp")
I need to redirect some of them to a page and that needs to open in a new window... This does not seem possible with VBS? Maybe add a JS function? Any sugestions welcome
Regards
Marnus
Such is Life!
|

March 16th, 2004, 12:34 PM
|
 |
Friend of Wrox
Points: 16,368, Level: 55 |
|
|
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,394
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Response.Redirect is only going to work within the existing window. Instead, you need to write out some javascript to open the new window when the page is redrawn. Instead of redirecting, you just write out the JS.
window.open(...)
But watch out for popup blockers.
Peter
------------------------------------------------------
Work smarter, not harder.
|

July 12th, 2004, 06:07 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
I have been using this method for a while now but it seems like popup stoppers is starting to cause problems. Is there any other way to open a new IE window without the popup stoppers blocking it?
Regards
Marnus
|

July 12th, 2004, 06:23 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Location: Cochin, Kerala, India.
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
There is a target attribute for HREF. You can set its value as _blank to open the link in a new window. For e.g. this link will open in a new window.
<a href="http://www.microsoft.com" target="_blank">Microsoft web site</a>
If you want to submit a form to a new page, the same attribute can be used in form tag.
BTW, could you please give some more details about the particular programming situation ? Then somebody may be able to give you better solution.
|

July 12th, 2004, 06:31 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Location: Rawalpindi, , Pakistan.
Posts: 322
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
function ak_forecolor()
{
var mycolor = showModalDialog(subdirectory + "insertcolors.html", "", ");
}
this function wil be open a windows of that file
Numan
--------------------------------------------------
Love is the most beautiful thing of this world. So do this !
|

July 12th, 2004, 11:18 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,477
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Marnus,
I too can't think of anything other than Javascript - window.open(...) method to achieve this. May be you can explain more an what you are trying to do, so that one would come up with alternative solutions if any.
_________________________
- Vijay G
Strive for Perfection
|

July 13th, 2004, 02:55 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Location: Johannesburg, , South Africa.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
Thanks for the replies. I have got a customer login page that authenticates on AD Accounts. So if the user logs in I check the group membership. Then I have got a "Select Case" to redirect them to a certian page/build a page depending oj the group. The one page is a Java App that doesnt look nice if it runs on the same page with the frames so I need to open this in a new window.
Regards
Marnus
|

July 18th, 2004, 08:30 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Location: Barrie, Ontario, Canada.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Use a function and call it in place of response.redirect. Like this...
<%
strLocation = "testlink.asp"
openlink(strLocation) ' replaces response.redirect
function openlink(link)
%>
<SCRIPT language='javascript'>window.open(' <%=strLocation%> ');</SCRIPT>
<%
end function
%>
Of course you can use all the parameters in the javascript for setting the new window, this is just a simple example of doing it in ASP. You could also use response.write inside of the code block instead of switching to HTML to create the function. your choice.
|

November 29th, 2004, 04:19 PM
|
|
Registered User
|
|
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Only thing you need to put the link in the js of the function because the function doesnt know what strLocation is.
So like this.
function openlink(link)
%>
<SCRIPT language='javascript'>window.open(' <%=link%> ');</SCRIPT>
<%
end function
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |