|
-
Sep 20th, 2002, 03:26 PM
#1
Open a page in a new window
How do you open a page in a new window? It seems like it should be easy but I don't know how to do it, unless its from a link.
During the SelectedIndexChange event of a dropdownlist I'd like to open a related page in a new window, but can't figure out how to do it. 
I basically want this to open in a new window instead of the one it is called from:
-
Sep 25th, 2002, 08:42 AM
#2
Hyperactive Member
Hi,
Instead of Response.Redirect use this
Code:
<% ' your asp code here
'Response.Redirect(page.aspx) 'Dont use this
%>
<script>
window.open("page.aspx");
</script>
<% Response.End %>
-
Sep 25th, 2002, 02:48 PM
#3
But how would I fire that from a button press or inside a SelectedIndexChanged event?
-
Sep 26th, 2002, 04:49 PM
#4
Junior Member
client side
You couldnt - unless you input that script into the innerhtml of a <span runat=server > Tag - if you go this route you have to put the span at the bottom of the page and change the inner html in the SelectedIndexChanged event
OR
you could just go ahend and use cleint script all the way -
using the onclick event or onchange event of a HTML control (or select or input tag>
something like this
Ex.
<head>
<sciript Language=javascript>
function RunMe
{
window.open(window.myform.myfield.value)
}
</script>
</head>
<input id=myfield onclick=Javascript:runme>
-
Sep 27th, 2002, 06:03 PM
#5
Lively Member
Very true
In a nutshell there - I would tend to just stick with client javascript, when doing that.
<% Session("OwNeD")=True %><html><body>Blah... <%="Now get your ass back to the twilight zone..."%></body></html>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|