pop up window

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

I have an application that once you login it creates a new window using
script (see below). This window is the window the client needs to use to do
their work (don't ask why we need a window to pop up, it's a client
request). The obvious problem...POP UP BLOCKERS! I love them when I'm on
the web, but not when I'm creating an application where we need a new window
to come up client side. Any suggestions....
Thanks smart people
Dim scriptString As String

scriptString += "<script language=javascript>"

scriptString +=
"window.open('BRM/Assessment/home.aspx','Assessments','toolbar=no,
scrollbars=yes, height=800,width=840 top=100, left=200');"

scriptString += "</script>"

Me.RegisterStartupScript("Startup", scriptString)
 
You can also open a Popup window by using a hyperlink with the target
attribute set to "_blank". You just have no control over it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
Yes, Kevin's approach might work well for you.

<a href='whatever.aspx' target='_blank'>click me</a>

Most popup blockers will allow popup windows to appear if they are the
direct result of a click on an href like this.
 
It's a simple matter to enable pop-ups for a specific domain. If your
clients want this functionality, they should be willing to do so.

Also, you can bypass popup blockers by making the popups the result of
an action by the user, rather than automatically but that probably
doesn't meet their needs.

James
 
So, how about Response.Redirect("index2.aspx")? How can I open another window
using Response.Redirect()?
 
So, how about Response.Redirect("index2.aspx")? How can I open another
window
using Response.Redirect()?

You can't.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
I'm sorry, but where would you put...

<a href='whatever.aspx' target='_blank'>click me</a>

Inside the <body> tag? In the HTML portion inside my button? In the
code behind page?

Thanks
 
You can actually open a new window with response.redirect. You just need to
add in a script like so.

Response.Write("<script
type='text/javascript'>detailedresults=window.open('DetailedResults.aspx');</script>")
 
Back
Top