以下のコードでは、属性「値」をラジオ ボタンに追加しています。ラジオ ボタンの「値」属性を文字列に設定する方法を知る必要があります。
前もって感謝します。
protected void Page_Load(object sender, EventArgs e)
{
RadioButton rdoAuthModeSingleFactor = new RadioButton();
rdoAuthModeSingleFactor.Text = authModeObj["AuthenticationModes"].ToString();
string authModeIdVal = authModeObj["AuthenticationModeId"].ToString();
rdoAuthModeSingleFactor.GroupName = "AuthModes";
rdoAuthModeSingleFactor.ID = "AuthModeRdoID";
rdoAuthModeSingleFactor.Attributes.Add("Value", authModeIdVal);
plhldrAuthModes1.Controls.Add(rdoAuthModeSingleFactor);
}
protected void btnAuthModeSave_Click(object sender, EventArgs e)
{
//Here iam using placeholder functionalities
// radio button object name is rdo
string authenticationModeCheckedVal = rdo.Text; // how to get value of radio button instead of text
}