Method 1: Use the server-side control radiobutton
First, set the autopostback attribute of radiobutton to true. The repeater binding code should be placed in the ispostback of pageload;
Second, save the selected information in radiobutton's checkedchanged.
Finally, in the itemdatabound event of repeater, determine which one was selected last time (this can be done after selection, that is, save the selected information to viewstate in the selectchange event of radiobutton ), then select this radiobutton.
======
The above process is: when the page is loaded, repeater is bound. In this case, no radiobutton is selected (you can also select it, but you need to provide the content of the information to be selected ), then, when radiobutton is selected, it will automatically send back and trigger the checkedchanged event. In the checkedchanged event, you need to mark the unique marker of the selected option, save the tag. For example, there are five rows in total with IDs ranging from 1 to 5. In this checkedchanged event, if radiobutton is selected, the ID is recorded to viewstate. Finally, bind the repeater. Binding of repeater triggers the onitemdatabound event. In this event, we need to traverse all radiobutton and check that the unique tag of radiobutton is the unique tag you recorded (that is, the information saved in viewstate ), if it matches the information you saved, set the radiobutton checked to true; otherwise, set false.
In this way, the radiobutton in repeater can be implemented by single choice.
Method 2: Use JS
Http://topic.csdn.net/t/20050622/08/4098124.html