asp.net - radio button check and uncheck other radio buttons the web form is connected with a database created using ms access -
i have 2 radio buttons in web application named male , female , used following code check button , uncheck other 1 isnt working when m ruunning both selected .what do?
protected void radiobutton1_checkedchanged(object sender, eventargs e) { if (radiobutton1.checked == true) { radiobutton2.checked = false; } else { radiobutton2.checked = true; } } protected void radiobutton2_checkedchanged(object sender, eventargs e) { if (radiobutton2.checked == true) { radiobutton1.checked = false; } else { radiobutton2.checked = true; }
you should using radiobuttonlist this. give radio buttons belong same group , automatically have behavior other buttons in group unchecked when different button in group checked.
Comments
Post a Comment