ASP.NET and Frames

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

First, I know frames are not exactly the best things to be using in an asp
application, but I had no other choice. My problem is that I now have
situations where one frame must update another. Is there a way to do this?

I have tried the following code:
string script = "javascript:parent.menu.location.reload(true);";
this.Page.RegisterStartupScript("reload", script);

but this does not work. Any suggestions?
 
Ben said:
Hello

First, I know frames are not exactly the best things to be using in an asp
application

Why is this?

, but I had no other choice. My problem is that I now have
situations where one frame must update another. Is there a way to do
this?

of course, you have to use jscript and reload the other frame.
I have tried the following code:
string script = "javascript:parent.menu.location.reload(true);";
this.Page.RegisterStartupScript("reload", script);

but this does not work. Any suggestions?

what error r u getting?

I would change it to

string script = "<script>parent.menu.location.reload(true) </script>"
 
I have a method that those lines of code are called from.

The code seems to run without throwing any errors, but the frame is not
updated.

Here is the exact code:
private void refreshMenu()
{
string script = "<script>parent.menu.location.reload(true)</script>";
this.Page.RegisterStartupScript("reload", script);
}

Thank you again for any additional help.
Ben
 
Ben,
Try something more like this:

string script =
"<script>window.parent.frames['menu'].location.reload(true);</script>";

--Peter
 
Hi,

You will not get any exception, the browser does not throw exceptions.

do something like:

in the aspx page:
<script<
function RefreshFrame()
{
alert(parent);
alert( parent.menu);
alert( parent.menu.location);
parent.menu.location.reload(true);
}
</script>
<body runat=server id=theBody>

in the .cs:
protected HtmlGenericControl theBody;

theBody.Attributes.Add( "onLoad", "RefreshFrame();");
 
Back
Top