rgrimm
asked on
Refresh IFRAME When Calendar Date Changes
I have a web page that contains a calendar control (Cal) and an IFrame (ifCal). The IFrame displays a page that contains a repeater control (repCalItems), which displays appointments for the selected date. If you select a date in the calendar control, I want the appointments for the selected date to display in the repeater within the IFrame.
I have set up the IFrame in the VB.NET codebehind with the following:
Protected WithEvents ifCal As System.Web.UI.HtmlControls .HtmlGener icControl
When I click a date on the Calendar control it calls this sub:
Private Sub Cal_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cal.SelectionChanged
Dim strTransferTo As String
strTransferTo = "../Calendar/CalItems.aspx ?Date=" & Cal.SelectedDate.ToShortDa teString
ifCal.Attributes().Item("s rc") = strTransferTo
End Sub
When I run my form I get the following error:
Object reference not set to an instance of an object.
It fails on this line of code:
ifCal.Attributes().Item("s rc") = strTransferTo
What am I doing wrong?
I have set up the IFrame in the VB.NET codebehind with the following:
Protected WithEvents ifCal As System.Web.UI.HtmlControls
When I click a date on the Calendar control it calls this sub:
Private Sub Cal_SelectionChanged(ByVal
Dim strTransferTo As String
strTransferTo = "../Calendar/CalItems.aspx
ifCal.Attributes().Item("s
End Sub
When I run my form I get the following error:
Object reference not set to an instance of an object.
It fails on this line of code:
ifCal.Attributes().Item("s
What am I doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have ID attribute setup in your IFRAME? You need to setup ID of your Frame and replace it with frameid in code:
document.getElementById('f rameid')
<iframe id="frameid" width=300 height=300>
</iframe>
-tushar
document.getElementById('f
<iframe id="frameid" width=300 height=300>
</iframe>
-tushar
ASKER
Found the problem. I forgot to change your 'frameid' to the name of my frame. Works great!
Thanks!
rick
Thanks!
rick
ASKER