473,473 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Beginner Question

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.
Nov 18 '05 #1
4 1370
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?queryStrin g=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.

"Jeremy" <je*************@blueyonder.co.yk> wrote in message
news:#Z**************@tk2msftngp13.phx.gbl...
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.

Nov 18 '05 #2
It's really that complicated ??

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?queryStrin g=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.

"Jeremy" <je*************@blueyonder.co.yk> wrote in message
news:#Z**************@tk2msftngp13.phx.gbl...
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.


Nov 18 '05 #3
>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
jj***@acinet.pt.n.o-s.p-a.m - www.acinet.pt
================================================== =====
Nov 18 '05 #4
> 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.

"Jeremy" <je*************@blueyonder.co.yk> wrote in message
news:OG**************@TK2MSFTNGP10.phx.gbl...
It's really that complicated ??

"Kevin Spencer" <ke***@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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?queryStrin g=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.

"Jeremy" <je*************@blueyonder.co.yk> wrote in message
news:#Z**************@tk2msftngp13.phx.gbl...
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.



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Svens | last post by:
Hey everyone! I'm a math student working on a short script involving logs. I have a function on my scientific calculator, and was wondering if there was a similar funtion in python. For example:...
3
by: jvax | last post by:
Hi all, I hope I'm posting in the right NG... I have a data text file I want to read from a c++ program. the data file goes like this: 90 # number of balls 33 42 13
1
by: Mike Malter | last post by:
I am just starting to work with reflection and I want to create a log that saves relevant information if a method call fails so I can call that method again later using reflection. I am...
14
by: z_learning_tester | last post by:
But I can't seem to find the answer. The question is how do you reverse the words in a string? Or how do you reverse the numbers listed in a string? The example is usually something like: Turn...
12
by: Blaze | last post by:
I am doing the first walk through on the Visual Studio .Net walkthrough book to learn a little about programming. I am having issues with the first tutorial not running correctly. It seems that...
5
by: optimistx | last post by:
As a beginner in javascript I had a question. I was reading FAQ and posts here. I became very unhappy: Obviously this group is mainly for wise, pedantic, unkind etc people, who already know...
10
by: Roman Zeilinger | last post by:
Hi I have a beginner question concerning fscanf. First I had a text file which just contained some hex numbers: 0C100012 0C100012 ....
4
by: a | last post by:
Dear all vb.net developer I want to know the time I need to master vb.net? I'm beginner
3
by: Ben Keshet | last post by:
I have a probably simple beginner's question - I have a script that I am currently able to print its output. instead, i want to write it into a file - I tried different versions of write() but...
2
by: roanhn | last post by:
Hello. I've to to write a master's thesis. Currently I deal with php, mysql, ajax. Fate decreed that I've to choose one of this subjects: 1.gdi+ library in .net technology 2.ado.net technology...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.