Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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)

wayne

 

The Road Goes on Forever and the Party Never Ends - Robert Earl Keen

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...