G
Gummy
Hello,
I am trying to create a user control that has a label and two radio buttons
for a survey. The idea is to populate a repeater (or datagrid, haven't
figured out the best way to do this) with the user control.
What will happen is it will read the database with a list of questions, each
question will populate the label and the user will click on either the Yes
or No radio buttons.
I am having problems getting the ASPX page and the ASCX to talk to each
other. At this point I am just trying to keep it simple as with the
following example:
I placed the YesNo.ascx on the ASPX page and added the declaration of:
Protected yno as New YesNo
at the top of the ASPX.
Then in the Page_Load I just have:
yno.SetName() = "a"
In the ASCX I added the following property:
Public Property SetName() as String
Get
Return lblName.Text
End Get
Set(ByVal Value as String)
lblName.Text = Value
End Set
End Property
When I run the page I get the follwing error: "Object reference not set to
an istance of an object" on the line:
lblName.Text = Value
What am I doing wrong? I assume it is a simple mistake.
Thanks for the help.
-Rob
I am trying to create a user control that has a label and two radio buttons
for a survey. The idea is to populate a repeater (or datagrid, haven't
figured out the best way to do this) with the user control.
What will happen is it will read the database with a list of questions, each
question will populate the label and the user will click on either the Yes
or No radio buttons.
I am having problems getting the ASPX page and the ASCX to talk to each
other. At this point I am just trying to keep it simple as with the
following example:
I placed the YesNo.ascx on the ASPX page and added the declaration of:
Protected yno as New YesNo
at the top of the ASPX.
Then in the Page_Load I just have:
yno.SetName() = "a"
In the ASCX I added the following property:
Public Property SetName() as String
Get
Return lblName.Text
End Get
Set(ByVal Value as String)
lblName.Text = Value
End Set
End Property
When I run the page I get the follwing error: "Object reference not set to
an istance of an object" on the line:
lblName.Text = Value
What am I doing wrong? I assume it is a simple mistake.
Thanks for the help.
-Rob