Beginner Question

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

How can I call another webform as a new window, as opposed to replacing the
content of the current window?
I need to be able to do this from code (eg. Server.Transfer) or implicitly
behind a hyperlink.

Thanks in advance.
 
You need to use Page.RegisterStartupScript() (on the server) to register a
JavaScript on the page that will run as soon as the page loads in the
browser. Something like:

Dim str As String = "<script
type=""text/javascript"">window.open('somepage.aspx?queryString=whatever');<
/script>"
If Not Page.IsStartupScriptRegistered("OpenWindow") Then
Page.RegisterStartupScript("OpenWindow", str)
End If

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
It's really that complicated ??

Kevin Spencer said:
You need to use Page.RegisterStartupScript() (on the server) to register a
JavaScript on the page that will run as soon as the page loads in the
browser. Something like:

Dim str As String = "<script
type=""text/javascript"">window.open('somepage.aspx?queryString=whatever');<
/script>"
If Not Page.IsStartupScriptRegistered("OpenWindow") Then
Page.RegisterStartupScript("OpenWindow", str)
End If

--
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
It's really that complicated ??

Yes it is...

You must understand that while you are working with a new platform (ASP.NET) on
the client the browser its the same... and basically what the client gets is
HTML. So you need to use the same tricks on the client side as you used with ASP
3.0 for instance. The good thing is that you have the tools in .NET to do it, as
Kevin demonstrated.

Joao Cardoso (MVP dotNET)
=======================================================
[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.programando.net/regras.aspx
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 
It's really that complicated ??

No, it's really that simple. There are quite a few things more complicated
than that with ASP.Net.

--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top