Click to See Complete Forum and Search --> : change the page on a different fame...?
ProgrammerJon
Apr 18th, 2004, 06:07 PM
How do you change the page a iframe...
When a user presses a button in frame A the page in frame B changes.
Can anyone tell me how to do this?
ThomasJones
Apr 19th, 2004, 06:47 AM
If you use a link simply setting the target attribute to the link will get the job done.
If you want to do it from the code behind on the server I normally use this function I created some time ago. Maybe it will help you or there may be an easier way already built into .net.
sub ButtonPressed
'FrameName is the name of the target frame you desire
postnavigate(me, "www.someurl.com","FrameName")
end sub
Public Function PostNavigate(ByVal wPage As Page, ByVal NavigateTo As String, Optional ByVal Target As String = "") As Boolean
Try
Dim tg As String = ""
Try
If Target.Length > 0 Then
tg = Target
End If
Catch ex As Exception
End Try
If tg.Length > 0 Then
wPage.Response.Write("<script>window.open('" & NavigateTo & "','" & tg & "');</script>")
Else
wPage.Response.Write("<script>window.location.href=" & Chr(34) & NavigateTo & Chr(34) & ";" & tg & "</script>")
End If
Return True
Catch ex As Exception
Return False
End Try
End Function
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.