Exposing Value of Control

J

Jason MacKenzie

The question is this:

Lets say I want to expose the selectedvalue of a dropdownlist control in a
web control library.

Public Property SelectedValue() As String
Get
Return me.ddlTest.selectedValue
End Get
Set(ByVal Value As String)

End Set
End Property

I add the ddlTest control in the CreateChildControls override (I'm
inheriting from WebControls). Since the CreateChildControls method fires
after the attempt to read the property I get an "Object reference not set to
an instance of an object. ".

Obviously my approach is wrong and any help is appreciated.

Jason MacKenzie
 

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
474,139
Messages
2,570,807
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top