Home All Groups Group Topic Archive Search About

Using a radiolistbox control within a datalist control

Author
23 May 2009 1:57 PM
woodwardonline
I have been doing well with learning ASP and VB, but I am stumped on the
following problem. I am hoping someone can give me some pointers..let me know
what I should be researching.

I have a datalist control that pulls test questions from a sql database into
the item template. I then have a radiobuttonlist control that pulls the
corresponding answer selections.

I can't figure out how to get the selected item from the radio box. I see my
datalist as an object, but cannot seem to find a way to get to the
radiobuttonlist and it's properties. Thanks for your input! -Dan

Author
4 Jun 2009 11:22 PM
Stan
On 23 May, 14:57, "woodwardonline" <u52106@uwe> wrote:
> I have been doing well with learning ASP and VB, but I am stumped on the
> following problem. I am hoping someone can give me some pointers..let me know
> what I should be researching.
>
> I have a datalist control that pulls test questions from a sql database into
> the item template. I then have a radiobuttonlist control that pulls the
> corresponding answer selections.
>
> I can't figure out how to get the selected item from the radio box. I see my
> datalist as an object, but cannot seem to find a way to get to the
> radiobuttonlist and it's properties. Thanks for your input! -Dan

Hi

The problem with using a DataList control to contain a RadioButtonList
in each row is that they each need their own datasource and can't
derive their values from the one supplying the DataList itself.

Presumably the number of questions that are to appear on a page at one
time isn't very large. It might be much simpler to declare a fixed set
of controls in a table and populate them programmatically with an
iteration routine that shouldn't be too hard to write. That way you
will have the benefit of straightforward event handling and reading
the selected values when the user submits the answers.

HTH