Results 1 to 2 of 2

Thread: change the page on a different fame...?

  1. #1

    Thread Starter
    Addicted Member ProgrammerJon's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    203

    change the page on a different fame...?

    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?

  2. #2
    Lively Member
    Join Date
    Apr 2003
    Posts
    114
    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.


    Code:
        
    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
    I can do all things with VB.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width