Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 20th, 2005, 12:12 PM   #1
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Talking Troubles with Response.Redirect and target = “_blank”

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);
}

If in first web form I use:

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.

If in first web form I omit target = “_blank”

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.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote
Old Jan 21st, 2005, 10:51 AM   #2
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Hello:
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_persona=" + sIdPersona + "','_blank')");
Response.Write("</script>");
}

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

A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span>
see07 is offline   Reply With Quote
Old Jan 21st, 2005, 11:20 AM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
I am glad that you figured it out man.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC