Redirecting from another frame

Discussion in 'ASP .Net' started by Bilbo, Jul 14, 2004.

  1. Bilbo

    Bilbo Guest

    Hello,

    How do I programatically redirect a page in "another frame" using C# in
    ASP.NET?

    Server.Transfer redirects the current page...not a different frame.

    Thanks.
     
    Bilbo, Jul 14, 2004
    #1
    1. Advertisements

  2. Bilbo

    Kyril Magnos Guest

    Hi Bilbo,

    You can do it by using the Page.RegisterStartupScript method.

    <pseudo-code>
    int frameIndex = 1;
    string newPage = "newPage.aspx";
    string script = string.Format("<script
    language=\"javascript\">parent.frames[{0}].location.href = '{1}';</script>",
    frameIndex, newPage);

    Page.RegisterStartupScript("ReloadFrame", script);
    </pseudo-code>

    HTH,

    Kyril

    -----Original Message-----
    From: Bilbo [mailto:]
    Posted At: Wednesday, July 14, 2004 10:54 AM
    Posted To: microsoft.public.dotnet.framework.aspnet
    Conversation: Redirecting from another frame
    Subject: Redirecting from another frame

    Hello,

    How do I programatically redirect a page in "another frame" using C# in
    ASP.NET?

    Server.Transfer redirects the current page...not a different frame.

    Thanks.
     
    Kyril Magnos, Jul 14, 2004
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.