hi all,

I am developing a server user control that has a DropDownList inside. I want my control to have a property that will expose the value of the DropDownList. Currently I am using the following to do so:
VB Code:
  1. Public Property ControlValue() As Long
  2.         Get
  3.             Return ddList.SelectedItem.Value
  4.         End Get
  5.         Set(ByVal Value As Long)
  6.             ddList.SelectedIndex = Value
  7.         End Set
  8.     End Property
where ddList is the DropDownList inside the User Control.
Unfortunately the above code is not working, when I am trying to retrieve the ControlValue property I get the following error:
System.NullReferenceException: Object reference not set to an instance of an object.

In fact I also tried to use a reference to the ddlist but it still does not work, could anybody please help me on this...