Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2005, 02:15 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Troubles with Response.Redirect and target = “_bla

Hello:
From a web form I want open a new web form which I send one parameter from first web form, I’m using this code:

if(this.CheckBox1.Checked == true)
{
string sIdPersona = "";
sIdPersona = TextBox3.Text;
Response.Redirect("WebForm2.aspx?id_persona=" + sIdPersona);
}

[u]If in first web form I use:</u>

Target = “_blank” in form of HTML

Then if CheckBox1 is checked, it’s showing me 2nd web form correctly in a new window, but if CheckBox1 is not checked it’s showing me again 1st window into a new window.

[u]If in first web form I omit target = “_blank”</u>

Then if CheckBox1 is checked, it’s showing me 2nd web form into same window, where 1st window was, such thing I don’t want; but if it is not checked then nothing happens, this is OK.

I wish attain new web form show in a 2nd window if CheckBox1 is checked and otherwise 1st web form stay there, do not opening again it in a 2nd window.

I’ll thank you in advance if you’ll be able to help me to attain it.

A.L.




El Hombre que tiene Amigos ha de mostrarse Amigo
__________________
El Hombre que tiene Amigos ha de mostrarse Amigo
 
Old January 21st, 2005, 04:26 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Do the process of opening an new window on the client side using javascript.OnClick of Checkbox,check if it is checked and open the new window using window.open().

 
Old January 21st, 2005, 07:41 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't think you can rely on "Redirect" to be able to open another window. That's not what it's intended for. It's indended to "Redirect" the current request. Use client side script as Santhi has suggested.

-Peter
 
Old January 21st, 2005, 12:53 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Shanti & Planoie:

At last I found a way to solve it:

I omit target = “_blank” of form in HTML.

And I modified code thus:

if(this.CheckBox1.Checked == true)
{
sIdPersona = TextBox3.Text;
Response.Write("<script>");
Response.Write("window.open('WebForm2.aspx?id_pers ona=" + sIdPersona + "','_blank')");
Response.Write("</script>");
}

I hope this solution work fine for other peoples with similar trouble.

A.L.


El Hombre que tiene Amigos ha de mostrarse Amigo





Similar Threads
Thread Thread Starter Forum Replies Last Post
response.redirect sarah lee ASP.NET 1.0 and 1.1 Basics 1 October 27th, 2006 08:57 AM
response.redirect ava_h .NET Framework 2.0 0 October 18th, 2006 10:21 PM
Response.Redirect Problems zanna5910 ASP.NET 1.0 and 1.1 Basics 1 September 30th, 2005 05:24 PM
response.redirect crmpicco Classic ASP Basics 3 February 9th, 2005 01:50 AM
Response.Redirect dhborchardt Classic ASP Basics 4 June 16th, 2003 05:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.