How to change which htm file is displaied in a tablecell

A

AAaron123

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??
 
A

AAaron123

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?
 
A

AAaron123

iframe must have
runat="server"

runs ok now!

AAaron123 said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top