Skip to content Skip to sidebar Skip to footer

Radio Button Stopped Working After Conversion From Asp.net 1.1 To Asp.net 3.5

[I'm posting our problem and solution below as an FYI. If you have an official statement from Microsoft or a representative organization about this issue, I'll mark that as an answ

Solution 1:

[I'm posting our problem and solution in this initial post as an FYI. If you have an official statement from Microsoft or a representative organization about this issue, I'll mark that as an answer. Otherwise, this post will serve as the answer].

Answer :

1) We set AutoPostBack to false for the RadioButtonList control. 2) In the PreRender event for the page, we manually add the new doPostBack function to each List item in the radio button list by looping through the list items in the RadioButtonList. 3) The code is as follows:

for (int i =0; i < rbList.Items.Count; i++)
{
    rbList.Items[i].Attributes.Add("onclick", "javascript:setTimeout('__doPostBack(\\'rbList$"+ i +"\\',\\'\\')', 0)");
}

4) The code in the onclick event function call matches the structure of what ASP.Net 3.5 + C# automatically generate.

After this fix, both radio buttons had onclick events functions and original functionality was restored.

Post a Comment for "Radio Button Stopped Working After Conversion From Asp.net 1.1 To Asp.net 3.5"