New "windows" in .NET

  • Thread starter Thread starter Stuart Brierley
  • Start date Start date
S

Stuart Brierley

Does anyone have any ideas how to open a new web browser
window in .NET?

I'm using ASP.NET with VB as the code behind, and after
some validation code may need to open a second browser
window.

Any help gratefully received.

Cheers
Stu.
 
In a standalone app, I have used

System.Diagnostics.Process.Start("http:\\news.bbc.co.uk")

Having no experience with ASP.NET I cannot comment on whether is it
supported; no doubt others in the NG will follow-up.

Regards
Hexathioorthooxalate
 
Launching a new window, or 'reusing' an old one is browser specific
behaviour. As far as I am aware you cannot control this for a "generic
browser" nicely from within your .Net app.

But to change the behaviour specifically for IE:

Launch IE/Tools/Internet Options/Advanced and ensure that the checkbox
"Reuse windows for launching shortcuts" doesn't have a tick next to it.

I hope you have a copy of SMS because otherwise you'll find yourself walking
around changing the settngs for every machine in the company!

Regards
Hexathioorthooxalate
 
Hi Hex,

You can get around the browser limitation by using the Javascript
protocol:

Process.Start ("javascript:(window.location ='http://www.google.com/')")

This isn't any good for ASP.NET, though, as Process isn't available
client-side.

For a client-side new window, the answers (using script) have already been
posted early today in a topic with a long name:
Open modal web form.... or "simirly" to modal :) What (and how) possible
to do?

Regards,
Fergus
 
Hi Stuart,

\\\
Dim str As String
str = "<script language=javascript> {window.open('http://www.google.com');}
</script>"
RegisterStartupScript("Startup", str)
///

This open an extra window, with what you cannot communicate with.

For a window to communicate with in vb.net you will need to use the
response.redirect

I hope this helps a little bit?

Cor
 
Back
Top