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

Discussion in 'ASP .Net' started by TC, Dec 7, 2004.

  1. TC

    TC Guest

    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
    TC, Dec 7, 2004
    #1
    1. Advertising

  2. TC

    Shiva Guest

    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" <> wrote in message
    news:...
    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
    Shiva, Dec 7, 2004
    #2
    1. Advertising

  3. TC

    TC Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > 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
    >
    >
    >
    TC, Dec 7, 2004
    #3
  4. TC

    TC Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    > 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
    >
    >
    >
    TC, Dec 7, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NWx
    Replies:
    3
    Views:
    450
  2. Achim Domma
    Replies:
    1
    Views:
    436
    Eliyahu Goldin
    Dec 4, 2006
  3. Andrew Jocelyn
    Replies:
    2
    Views:
    1,513
    Allen Chen [MSFT]
    Apr 27, 2009
  4. Sal
    Replies:
    1
    Views:
    374
  5. geefypants
    Replies:
    0
    Views:
    142
    geefypants
    Oct 28, 2004
Loading...

Share This Page