I need to built a list of radio buttons, based on data I return from my DB. Each button needs to have a value associated with it that I can get out based on the selected button.
Ideally I would just use the RadioButtonList
control, however, I need to have a very custom layout which a RadioButtonList
doesn't appear to be able to handle.
An alternative would be to create individual RadioButton
s and wrap them in a Panel to group them. However, there doesn't appear to be a Value property on a RadioButton
?
Is there an alternative way to set a value to a RadioButton
control? Alternatively, a way to completely customise the RadioButtonList
output.
At the moment, I'm thinking I might have to resort to using HTML radio buttons with runat="server"
, must be a better way...?
Definition and Usage. The value property sets or returns the value of the value attribute of the radio button. For radio buttons, the contents of the value property do not appear in the user interface. The value property only has meaning when submitting a form. If a radio button is in checked state when the form is submitted,...
Select a property, the value of which will be set by the radio button selected at run time. You can configure a list of options for the radio buttons in the List Source area, as well as select the caption and value for the radio button options.
The .NET MAUI RadioButton is a type of button that allows users to select one option from a set. Each option is represented by one radio button, and you can only select one radio button in a group. RadioButton - .NET MAUI | Microsoft Docs Skip to main content This browser is no longer supported.
VB.Net - RadioButton Control. The RadioButton control is used to provide a set of mutually exclusive options. The user can select one radio button in a group.
You could create your own radio button class which extends the standard one and adds a value property:
public class ValueCheckBox : System.Web.UI.WebControls.RadioButton
{
public string Value { get; set; }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With