Theo Posted August 30, 2006 Posted August 30, 2006 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 Quote
wayneph Posted September 1, 2006 Posted September 1, 2006 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) Quote wayne The Road Goes on Forever and the Party Never Ends - Robert Earl Keen
Theo Posted September 4, 2006 Author Posted September 4, 2006 I've discovered that it can be done like this aswell: 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.