A
AlecL
Please help!!!
I am creating dropdownlists, the number of which and its listitem is
determined on the value of other controls. The dropdowns are created
fine in a place holder, but when I go to retrieve the selectedvalue
like this:
sMentChildGender = CType(Page.FindControl("ddlMentChildGender" &
childcount), DropDownList).SelectedValue
sMentChildAge = CType(Page.FindControl("ddlMentChildAge" &
childcount), DropDownList).SelectedValue
it gives me a "System.NullReferenceException: Object reference not set
to an instance of an object" error. These dropdowns has to be created
as the result of the value of other control so they are created in a
SelectedIndexChanged code. Is that correct?
PLease help!!!!
Al
I am creating dropdownlists, the number of which and its listitem is
determined on the value of other controls. The dropdowns are created
fine in a place holder, but when I go to retrieve the selectedvalue
like this:
sMentChildGender = CType(Page.FindControl("ddlMentChildGender" &
childcount), DropDownList).SelectedValue
sMentChildAge = CType(Page.FindControl("ddlMentChildAge" &
childcount), DropDownList).SelectedValue
it gives me a "System.NullReferenceException: Object reference not set
to an instance of an object" error. These dropdowns has to be created
as the result of the value of other control so they are created in a
SelectedIndexChanged code. Is that correct?
PLease help!!!!
Al