473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Open page in new window instead of using redirect

I need to open a page in a new window from the code behind. Normally I use
response.redirect to navigate to a new page but up to now its always been in
the same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?

--
mo*******@nospam.com
Nov 18 '05 #1
5 5564
You'll have to write out a script that runs when the page loads to switch the page, you can't open a new browser from the server. The Page.RegisterStartupScript() method would work great for this.

"moondaddy" <mo*******@nospam.com> wrote in message news:OL**************@TK2MSFTNGP11.phx.gbl...
I need to open a page in a new window from the code behind. Normally I use
response.redirect to navigate to a new page but up to now its always been in
the same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?

--
mo*******@nospam.com

Nov 18 '05 #2
On Thu, 8 Jul 2004 16:16:20 -0500, "moondaddy" <mo*******@nospam.com>
wrote:
I need to open a page in a new window from the code behind. Normally I use
response.redirect to navigate to a new page but up to now its always been in
the same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?


this.RegisterClientScriptBlock("","<script language='JavaScript'>
window.showModalDialog('url','mynewwindow','myopti ons');</script>");

-adam
Nov 18 '05 #3
Write javascript from your codebehind and add it to the page.controls
collection.

example:
Page.Controls.Add(new LiteralControl("<script language =
\"javascript\">"));
Page.Controls.Add(new LiteralControl(window.open("xyz.htm");));
Page.Controls.Add(new LiteralControl("</script>"));

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 16:16:20 -0500, "moondaddy" <mo*******@nospam.com>
wrote:
I need to open a page in a new window from the code behind. Normally I use
response.redirect to navigate to a new page but up to now its always been in
the same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?


Nov 18 '05 #4
this approach will not work with xp service pack 2 , due out shortly

-- bruce (sqlwork.com)
"Bobby Ryzhy" <br****@hotmail.com> wrote in message
news:63********************************@4ax.com...
Write javascript from your codebehind and add it to the page.controls
collection.

example:
Page.Controls.Add(new LiteralControl("<script language =
\"javascript\">"));
Page.Controls.Add(new LiteralControl(window.open("xyz.htm");));
Page.Controls.Add(new LiteralControl("</script>"));

Bobby Ryzhy
bo***@weekendtech.net
http://www.weekendtech.net

On Thu, 8 Jul 2004 16:16:20 -0500, "moondaddy" <mo*******@nospam.com>
wrote:
I need to open a page in a new window from the code behind. Normally I useresponse.redirect to navigate to a new page but up to now its always been inthe same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?

Nov 18 '05 #5
Try this

Response.Write("<script
type='text/javascript'>detailedresults=window.open('..Your Page
Here...');</script>")

"moondaddy" wrote:
I need to open a page in a new window from the code behind. Normally I use
response.redirect to navigate to a new page but up to now its always been in
the same window. I know how to do it from JavaScript in the browser, but
this logic needs to run from the server.

Any good ideas?

--
mo*******@nospam.com

Nov 18 '05 #6

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

Similar topics

1
by: Wes | last post by:
This should be really simple ... but how to do it has been eluding me ... I am writing an ASP.NET application and am using ASP.ImageButtons & ASP.Buttons. Instead of redirecting to another...
6
by: lukeo | last post by:
I'm shelling out to an .asp (or htm) page from an application. I want to show this in a window without the address bar, etc... Is there a way I can redirect this page using javascript to a page...
4
by: margaret | last post by:
James suggested that I used window.open on the client side to open a new window. I created a test ASP app and can get it work fine. But now I'm trying to fix my real app, which is in ASP.NET. It...
3
by: eieed | last post by:
I have a web page that is designed to allow users to run crystal reports which are then exported into PDF formats. Currently, when the user clicks the "Submit" button there is some processing to...
1
by: Jon Angel | last post by:
I'm relatively new to C# and need to maintain an application that opens a new browser window with a URL like this: ...
1
by: Nevyn Twyll | last post by:
I have a DataList; in the DataList's , I have a LinkButton and a few listboxes. When the LinkButton is pressed, I need to get the ID of the selected item in one of the Listbox controls. Then I...
1
by: chirakg21 | last post by:
I have a one single login page with two textbox of Username(txtUsername) and password (txtPassword) and two buttons with one Login(cmdLogin) and Cancel(cmdCancel). Now in the code behind I have...
2
by: buran | last post by:
Dear ASP.NET Programmers, I am using the following code block to navigate to the invoice page of my app. when users click on the button btnInvoice. However, I want to display the invoice page in...
6
by: bushi | last post by:
hi everyone! i have diplayed my hyperlinks in a iframe.when i redirect to next page.the next page also open in the same frame,but i want to open a new browser window,when i click on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.