Opening new browser from .NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello I am new to VS2003 .NET development and therefore have a really simple
question:

How do you open a new browser from within the code (I am using VB)?

I know you can use Respose.Redirect command to go to a different form in the
same browser.

ALso if the application tries to open a new browser will it be blocked by
popup blockers?

Thanks,
Ashhad.
 
Hello Ashhad,

Use Response.Write() with JavaScript openning new window

AS> Hello I am new to VS2003 .NET development and therefore have a
AS> really simple question:
AS>
AS> How do you open a new browser from within the code (I am using VB)?
AS>
AS> I know you can use Respose.Redirect command to go to a different
AS> form in the same browser.
AS>
AS> ALso if the application tries to open a new browser will it be
AS> blocked by popup blockers?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
You can't do this "directly" because the code you write with .NET runs on a
web server, but only a browser can open another browser and the browser runs
on the client.

So, what you have to do is pass client-side code from the server to the
client (where it will then execute).

The simplest way is to send this:

Response.Write("<SCRIPT
Language='JavaScript'>window.Open('targetURL')</SCRIPT>")

As for popup blockers, they should not block this because popup blockers
usually open popups that come from ad servers (different domains than the
one the user is currently recieving data from) and your popup would be
coming from the same domain.

-Scott
 
Back
Top