Redirecting from another frame

B

Bilbo

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.
 
K

Kyril Magnos

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:[email protected]]
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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top