RadioButtonList - problem with selected value

N_K

Member
Joined
Oct 10, 2006
Messages
22
Programming Experience
3-5
Hi,

I have a RadioButtonList but am having issues obtaining the selectedvalue.

I have the following:

VB.NET:
        DataTable = FaqCatAdapter.GetFaqCat

        RBLFaqCat.DataSource = DataTable
        RBLFaqCat.DataTextField = "Description"
        RBLFaqCat.DataValueField = "WFaqCatId"

        RBLFaqCat.DataBind()

Now this works fine and I can see in the source that is generated that the correct values are there aswell as the text.

However something doesnt seem right when using the SelectedValue. quite simply when i select a radio button and want to use it i get nothing output.

see here (code from a submit button's Click event):

VB.NET:
Dim FaqCat As String = RBLFaqCat.SelectedValue
...
 Response.Write("<br />FaqCat = " & FaqCat)

This outputs nothing where there should be a number coming from FaqCat.

any Idea why this is?
 
Back
Top