471,066 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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

TC
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
Nov 16 '05 #1
3 1777
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" <ge**********@yahoo.com> wrote in message
news:Ok**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #2
TC
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" <sh******@online.excite.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
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" <ge**********@yahoo.com> wrote in message
news:Ok**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #3
TC
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" <sh******@online.excite.com> wrote in message
news:uK**************@TK2MSFTNGP15.phx.gbl...
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" <ge**********@yahoo.com> wrote in message
news:Ok**************@TK2MSFTNGP15.phx.gbl...
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

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by PaulThomas | last post: by
56 posts views Thread by UKuser | last post: by
18 posts views Thread by Paul Lautman | last post: by
reply views Thread by leo001 | last post: by

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.