By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,759 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,759 IT Pros & Developers. It's quick & easy.

ASP.NET and Frames

P: n/a
Ben
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?
May 15 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:C2**********************************@microsof t.com...
but this does not work.


How do you know it doesn't work...?
May 15 '06 #2

P: n/a

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:C2**********************************@microsof t.com...
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>"

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
May 15 '06 #3

P: n/a
Ben
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

"Ignacio Machin ( .NET/ C# MVP )" wrote:

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:C2**********************************@microsof t.com...
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>"

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

May 15 '06 #4

P: n/a
Ben,
Try something more like this:

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

--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ben" wrote:
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?

May 15 '06 #5

P: n/a
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();");
"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:73**********************************@microsof t.com...
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

"Ignacio Machin ( .NET/ C# MVP )" wrote:

"Ben" <ben_1_ AT hotmail DOT com> wrote in message
news:C2**********************************@microsof t.com...
> 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>"

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

May 15 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.