Hi,
I am trying to add a custom control into my own control called
'DateRange.ascx'.
Easier said than done. In the DateRange.ascx file it has two text
boxes called dfDateFrom and dfDateTo and also two properties which get
and set the textboxes data, see below :-
Public Property dtFrom() As String
Get
Return dfDateFrom.Text
End Get
Set(ByVal Value As String)
dfDateFrom.Text = Value
End Set
End Property
Public Property dtTo() As String
Get
Return dfDateTo.Text
End Get
Set(ByVal Value As String)
dfDateTo.Text = Value
End Set
End Property
So why is it that when from my 'TestDatesWithControl.aspx.vb'
(codebehind) file when I try and retrieve the data from one of the
fields in the control I get the following error :-
Object reference not set to an instance of an object
This is when I try and reference it in the following way (on click of
a button):-
Imports KREIOS_Site.CustomControls
Dim y As New UCDateRange
y.Start()
' IT GOES WRONG BELOW with the following error.
' Object reference not set to an instance of an object
lbTest2.Text = y.dtFrom
If you would like to see the actual source code please go to :-
http://www.levelup.co.uk/code/
Please Help.
Regards
Jay