Ah i see, so you're using
.net - You have to be specific of the technologies you're using. ASP is
not asp.net - they are very different and the experts in this forum are proficient with classic asp, we generally know little about .net programming - so you'll find it difficult to get the help you require.
However, I know enough to fake my way around a bit.. so I'll try to give you a hand.
You'll need to do something like: This is of course in Visual Basic.
-
Sub CheckRadio(s As Object, e As EventArgs)
-
If Request.Form("BtnList1") Is Nothing Or Request.Form("BtnList1") = "" Then
-
YourLabel.Text = "You did not select an item from the radio button list control!"
-
Else
-
YourLabel.Text = "You selected the following... " & BtnList1.SelectedIndex.Text
-
End If
-
End Sub
-
Yes, you'll have to do that for all of them. Or, you can try something like this but i'm not entirely certain how this will work in .net
-
Sub CheckRadio(s As Object, e As EventArgs)
-
For Each oItem As Object In Request.Form
-
If Request.Form(oItem) Is Nothing Or Request.Form(oItem) = "" Then
-
YourLabel.Text = "You did not select an item from the radio button list control!"
-
Else
-
YourLabel.Text = "You selected the following... " & oItem.SelectedIndex.Text
-
End If
-
Next
-
End Sub
-
And call this sub onSubmit. Or if you want to test it try calling it OnClick of the radiolistcontrol to see what you get.
Here is a reference: (look at the displayMessage() Sub)
http://www.w3schools.com/aspnet/show...raylist_radio1
If this still doesn't help.. I will have a mod move this thread to the .net forums where the resident experts there will be able to help you more than we can.
Sincerely,
Mark
Hi
Thank you all I understand what you said and I try it
But I want to use RadioButtonList
Not <input type="radio" name="BtnList1" >
Because my page will be for evaluation
Then for every Quest there is many choises.. so I used RadioButtonList
I tried to do what you tell me.. but I get some error
Becouse I don’t know how to creat an array for RadioButtonList
And do (loop to check them)
OR I must use input type="radio" to use arry ???