D
Dave E
Hi all,
right now I feel pretty dumb - even dumber than I look. I have read endless
web articles on this, including the excellent site by Steve Orr
(http://steveorr.net/faq/PassDataToUserControl.aspx) on this very issue,
sadly to no avail in my case.
I've followed the examples and can only get the glorious "Object reference
not set to an instance of an object" error when I attempt to set the public
property on the control. Intellisense picks up the [IsCheckout] property on
the control and so at least that part is OK. I tried calling a public sub
on the control from a button press on the parent page but same error.
Essentially I just want to pass a simple boolean to the control to give it
context but this one has cost me much sleep - must be a *very* simple answer
I'm guessing.
My code is as follows (please don't laugh...):
[------- My control (i_cart_list1) --]
Private blnIsCheckout As Boolean
Public Property IsCheckout() As Boolean
Get
Return blnIsCheckout
End Get
Set(ByVal Value As Boolean)
blnIsCheckout = Value
End Set
End Property
[------- Parent page --]
Protected WithEvents Checkout As i_cart_list1
Private Sub Page_Load(blah blah here...)
Checkout.IsCheckout = True '<== Error happens here
End Sub
-----------------------------
Many thanks in advance for any help on this nasty.
Cheers,
David E (Sydney)
right now I feel pretty dumb - even dumber than I look. I have read endless
web articles on this, including the excellent site by Steve Orr
(http://steveorr.net/faq/PassDataToUserControl.aspx) on this very issue,
sadly to no avail in my case.
I've followed the examples and can only get the glorious "Object reference
not set to an instance of an object" error when I attempt to set the public
property on the control. Intellisense picks up the [IsCheckout] property on
the control and so at least that part is OK. I tried calling a public sub
on the control from a button press on the parent page but same error.
Essentially I just want to pass a simple boolean to the control to give it
context but this one has cost me much sleep - must be a *very* simple answer
I'm guessing.
My code is as follows (please don't laugh...):
[------- My control (i_cart_list1) --]
Private blnIsCheckout As Boolean
Public Property IsCheckout() As Boolean
Get
Return blnIsCheckout
End Get
Set(ByVal Value As Boolean)
blnIsCheckout = Value
End Set
End Property
[------- Parent page --]
Protected WithEvents Checkout As i_cart_list1
Private Sub Page_Load(blah blah here...)
Checkout.IsCheckout = True '<== Error happens here
End Sub
-----------------------------
Many thanks in advance for any help on this nasty.
Cheers,
David E (Sydney)