Run into the bug that is detailed here today only with asp.net 2.0 datalists, has anyone else seen this?
I ran into this bug a few days ago. I ended up using the javascript method from this message: http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet/msg/f2234ba565b8effa?dmode=source&output=gplain as a workaround.
I recently used the fix you mentioned. What I'm having trouble grasping now is how to determine which radiobutton was selected. There is no "CommandName" to set on radiobutton so you cant use itemcommand of the datalist or repeater right?
Simply loop through the controls as in the javascript function and instead of setting each radiobuttons checked state, see if it is checked or not. If you hit a control with a checked state, that is the selected control.
i.e.:
if (re.test(elm.name))
{
if (elm.checked)
// elm is the selected radiobutton.
}
Would it not be simpler to use an html control with runat=server in some sort of repeater (or build a control that does this) and take control of the html output rather than fiddle with the html's state on the client side?
I'm talking about is determining which repeater item is selected on the server side. Client side doesnt really help me unless I can do some sort of callback in the method...
Possibilities for server side...
Loop through the controls in the repeater and look for a selected radio button. Determine the repeater item from there?
I've tried the following to get the value server-side, but it doesn't seem to work for me:
If IsPostBack Then
For Each ri As RepeaterItem In Answers.Items
Dim AnswerButton As RadioButton
AnswerButton = CType(ri.FindControl("AnswerButton"), RadioButton)
If AnswerButton.Checked Then
Me.answer = ri.ItemIndex.ToString()
End If
Next
Can i get solution for this problem. like which radiobutton is selected
having same problem very frustrated.. yeah figured out the javascript thing, no biggie, only after 6 hours... BAH! so now its checking correctly, but when I findcontrol, the value always says unchecked??
thank you for your coding travis