How to change which htm file is displaied in a tablecell

Discussion in 'ASP .Net' started by AAaron123, Aug 7, 2008.

  1. AAaron123

    AAaron123 Guest

    I have a tablecell containing two radio buttons.
    I have two htm files.
    If one button is checked I'd like one of the file's contents to show.
    If the other button is checked I like the other file's contents to show.

    I found out about GroupName and AutoPostback so that works.
    In the code behind CheckedChanged events I wanted to read the files.

    Maybe use an iframe in the cell and set its src in the events. But it
    appears the event code does know about the iframe.

    Reading I came across using document.all.oFrame but that doesn't appear to
    work in the events.

    Can you point me to an approach?

    Thanks

    ps Is iframe treated as markup on the server and simply passed along??
     
    AAaron123, Aug 7, 2008
    #1
    1. Advertising

  2. AAaron123

    AAaron123 Guest

    Protected WithEvents frame1 As System.Web.UI.HtmlControls.HtmlGenericControl

    Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles RadioButton1.CheckedChanged

    Dim frame1 As HtmlControl = CType(Me.FindControl("MissionSchedule"),
    HtmlControl)

    frame1.Attributes("src") = "Mission.htm"

    End Sub



    I found the above on the Internet.

    Guess "Protected" does not set aside memory so the Dim is needed. Correct?



    But Me.FindControl("MissionSchedule") returns Nothing even though:

    <iframe id="MissionSchedule" src="Schedule.htm" ...

    I'd appreciate any suggestions?







    "AAaron123" <> wrote in message
    news:%23w4fWrC%...
    >I have a tablecell containing two radio buttons.
    > I have two htm files.
    > If one button is checked I'd like one of the file's contents to show.
    > If the other button is checked I like the other file's contents to show.
    >
    > I found out about GroupName and AutoPostback so that works.
    > In the code behind CheckedChanged events I wanted to read the files.
    >
    > Maybe use an iframe in the cell and set its src in the events. But it
    > appears the event code does know about the iframe.
    >
    > Reading I came across using document.all.oFrame but that doesn't appear to
    > work in the events.
    >
    > Can you point me to an approach?
    >
    > Thanks
    >
    > ps Is iframe treated as markup on the server and simply passed along??
    >
    >
    >
    >
    >
    >
    >
    >
    >
     
    AAaron123, Aug 7, 2008
    #2
    1. Advertising

  3. AAaron123

    AAaron123 Guest

    iframe must have
    runat="server"

    runs ok now!

    "AAaron123" <> wrote in message
    news:eMnA0CD%...
    > Protected WithEvents frame1 As
    > System.Web.UI.HtmlControls.HtmlGenericControl
    >
    > Protected Sub RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e
    > As System.EventArgs) Handles RadioButton1.CheckedChanged
    >
    > Dim frame1 As HtmlControl = CType(Me.FindControl("MissionSchedule"),
    > HtmlControl)
    >
    > frame1.Attributes("src") = "Mission.htm"
    >
    > End Sub
    >
    >
    >
    > I found the above on the Internet.
    >
    > Guess "Protected" does not set aside memory so the Dim is needed. Correct?
    >
    >
    >
    > But Me.FindControl("MissionSchedule") returns Nothing even though:
    >
    > <iframe id="MissionSchedule" src="Schedule.htm" ...
    >
    > I'd appreciate any suggestions?
    >
    >
    >
    >
    >
    >
    >
    > "AAaron123" <> wrote in message
    > news:%23w4fWrC%...
    >>I have a tablecell containing two radio buttons.
    >> I have two htm files.
    >> If one button is checked I'd like one of the file's contents to show.
    >> If the other button is checked I like the other file's contents to show.
    >>
    >> I found out about GroupName and AutoPostback so that works.
    >> In the code behind CheckedChanged events I wanted to read the files.
    >>
    >> Maybe use an iframe in the cell and set its src in the events. But it
    >> appears the event code does know about the iframe.
    >>
    >> Reading I came across using document.all.oFrame but that doesn't appear
    >> to work in the events.
    >>
    >> Can you point me to an approach?
    >>
    >> Thanks
    >>
    >> ps Is iframe treated as markup on the server and simply passed along??
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >
    >
     
    AAaron123, Aug 7, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian K. Williams

    TableCell oTableCell = new TableCell(); noWrap?

    Brian K. Williams, Apr 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,578
    Brian K. Williams
    Apr 30, 2004
  2. Vadim
    Replies:
    1
    Views:
    461
    Eliyahu Goldin
    Feb 24, 2005
  3. Kylin
    Replies:
    3
    Views:
    363
    Peter Larsson
    May 14, 2005
  4. Replies:
    3
    Views:
    310
    Ryan Ginstrom
    Aug 27, 2007
  5. Replies:
    6
    Views:
    181
    Dr.Ruud
    Feb 6, 2007
Loading...

Share This Page