Open Window, Please Help!

B

bucrepus

I know response.redirect doesn't open a new page. I have read many posts on
how to fix this but I can't get the first one to work. Please help.. I have
tried on 2 diff dev machines with no success (VS 2003) ASP.NET Web appl.
with Java Script setting in design properties.
I created a simple app with one button, under this button I have tried:
just to test the command Page.RegisterStartupScript I tried:

Page.RegisterStartupScript("TEST", "<script>alert(TEST MESSAGE');</script>")
pops up a 'message box'
WORKS GREAT!

BUT THE OPEN NEW WINDOW THING, I HAVE TRIED
Dim URL As String
URL = "a url string", tried several different public sites as well
as my own
Response.Write("<script language=JavaScript>window.open('" & URL &
"')</script>")
Exit Sub
DID NOTHING BUT FLASH, STAYED AT SAME PAGE..
TRIED:
Dim strURL As String
strURL = "http://www.microsoft.com/"
' Open your URL in a new window
Response.Write("<script>window.open('" & strURL & "',null,
'toolbar=no,menubar=no,scrollbars=yes,resizable=yes,width=575px,height=400px
')</script>")
Exit Sub
SAME RESULTS

TRIED:
RegisterStartupScript("OpenWindowScript", "<script
language=""javascript"">window.open(""www.MSN.com"");</script>")
SAME RESULTS

TRIED:
Page.RegisterStartupScript("openwin",
"<script>window.open('www.microsoft.com');</script>")
SAME RESULTS

HELP!
How can I get something to work? Thnaks greatly.. Buc..
 
R

Rob T

I usually just do a response.write("window.open('www.cnn.com', '_blank',
'height=400,width=585,titlebar=yes,top=25,left=25,scrollbars=yes,status=no,r
esizable=yes');")

Works great....just make sure your browser doesn't have a popup blocker
install....you'll run into problems if your unknown clients block popups
too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top