Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to Redirect to Another Already Open Page (Managing Multiple Open Pages in ASP.Net)

Reply
Thread Tools

How to Redirect to Another Already Open Page (Managing Multiple Open Pages in ASP.Net)

 
 
TC
Guest
Posts: n/a
 
      12-07-2004
Hello,

In ASP.Net via C#, but if someone can help me with a VB.Net example that's
fine too, I am trying to redirect to a page that is already open.

For example, when a user clicks a submit button on the main page, a new
window is opened that displays the material. The user then goes back to the
main page and makes changes and clicks the submit button again.

Rather than opening a new window again, I want the user to be redirected to
the original second page.

Does anybody have VB.Net or C# sample code for this?

Thanks & Regards,

TC


 
Reply With Quote
 
 
 
 
Shiva
Guest
Posts: n/a
 
      12-07-2004
Give a name for the new window - 2nd parameter for window.open(). If the
browser finds a window opened already with the given name, then it will
reuse it.

E.g.:

var p = window.open ("http://www.google.com", "Google");
p.focus();

"TC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Hello,

In ASP.Net via C#, but if someone can help me with a VB.Net example that's
fine too, I am trying to redirect to a page that is already open.

For example, when a user clicks a submit button on the main page, a new
window is opened that displays the material. The user then goes back to the
main page and makes changes and clicks the submit button again.

Rather than opening a new window again, I want the user to be redirected to
the original second page.

Does anybody have VB.Net or C# sample code for this?

Thanks & Regards,

TC



 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      12-07-2004
Shiva,

Thanks a bunch!

I finally understand. I was having some trouble with the javascript
implementation.

I will post a code sample in a bit for all of those who are to follow.

Best Regards,

TC


"Shiva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Give a name for the new window - 2nd parameter for window.open(). If the
> browser finds a window opened already with the given name, then it will
> reuse it.
>
> E.g.:
>
> var p = window.open ("http://www.google.com", "Google");
> p.focus();
>
> "TC" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> Hello,
>
> In ASP.Net via C#, but if someone can help me with a VB.Net example that's
> fine too, I am trying to redirect to a page that is already open.
>
> For example, when a user clicks a submit button on the main page, a new
> window is opened that displays the material. The user then goes back to
> the
> main page and makes changes and clicks the submit button again.
>
> Rather than opening a new window again, I want the user to be redirected
> to
> the original second page.
>
> Does anybody have VB.Net or C# sample code for this?
>
> Thanks & Regards,
>
> TC
>
>
>



 
Reply With Quote
 
TC
Guest
Posts: n/a
 
      12-07-2004
Below is code that, for the most part, works. However, one has to click the
button twice in order to actually re-direct with focus.

private void btnNewPDFWindow_Click(object sender, System.EventArgs e)

{

string NewPage = "NewPageZoom.aspx";

string ScriptBlockNewPage = "<script language='javascript'>var
NewPDFPage=window.open('" + NewPage + "','PDFPage');";

ScriptBlockNewPage = ScriptBlockNewPage + "NewPDFPage.focus();</script>";

Response.Write(ScriptBlockNewPage);

}




"Shiva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Give a name for the new window - 2nd parameter for window.open(). If the
> browser finds a window opened already with the given name, then it will
> reuse it.
>
> E.g.:
>
> var p = window.open ("http://www.google.com", "Google");
> p.focus();
>
> "TC" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> Hello,
>
> In ASP.Net via C#, but if someone can help me with a VB.Net example that's
> fine too, I am trying to redirect to a page that is already open.
>
> For example, when a user clicks a submit button on the main page, a new
> window is opened that displays the material. The user then goes back to
> the
> main page and makes changes and clicks the submit button again.
>
> Rather than opening a new window again, I want the user to be redirected
> to
> the original second page.
>
> Does anybody have VB.Net or C# sample code for this?
>
> Thanks & Regards,
>
> TC
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to stop editing another row in a Gridview, ReorderList etc when another row is already being edited Andrew Jocelyn ASP .Net 2 04-27-2009 02:01 AM
How to redirect From on Page to Another Page varmansk HTML 0 11-30-2008 04:53 PM
Open page in an already open frame - works in ie but not in Mozilla geefypants Javascript 0 10-28-2004 10:45 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM
How to make a page stay open only for few soconds, then redirect automaticaly to another page NWx ASP .Net 3 02-16-2004 05:21 PM



Advertisments