Redirect into another frame?

Theo

Newcomer
Joined
Aug 11, 2006
Messages
14
Location
Netherlands
Hi all,

I know that one should always try to avoid frames, but in this case I'm just curious.

I've got 2 frames: frame1, frame2. Frame1 has a button. When this button is clicked I want to show the page test.aspx inside frame2. How can I do this?


Thanks,

Theo
 
Do you need to PostBack? Or do you just want to bring it up like a link.

The easiest way is to Add a Target Attribute to a link. Otherwise if you just need to bring up a link you can use client side JavaScript.

If it posts back, then during the page rendering you'll need to spit out some JavaScript to tell Frame2 to change as well.

(One possible JavaScript example is here: http://www.pageresource.com/jscript/jframe2.htm)
 
I've discovered that it can be done like this aswell:

Code:
    Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWerknemers.Click
        Response.Write("<script language='JavaScript'>parent.mainFrame.location.href='test.aspx'</script>")
    End Sub
 
Back
Top