我有一个带有3
按钮的RadioButton
控件。
我正在从 SharePoint 列表中检索一个值,并根据检索到的值选择 RR 控件。
以下哪种方法是正确的使用方法?
ResignationTypeRBList.SelectedValue = _request.ResignationType;
ResignationTypeRBList.SelectedItem = _request.ResignationType;
ResignationTypeRBList.SelectedIndex = _request.ResignationType;
<asp:RadioButtonList ID="ResignationTypeRBList" RepeatDirection="Horizontal" runat="server" CausesValidation="false">
<asp:ListItem Text="Resignation" Value="Resignation" Selected="True"></asp:ListItem>
<asp:ListItem Text="NPL" Value="NPL"></asp:ListItem>
<asp:ListItem Text="Others" Value="Others"></asp:ListItem>
</asp:RadioButtonList>
谢谢
如果要从 SharePoint 列表中获取值,请将其分配给 SelectedValue
ResignationTypeRBList.SelectedValue = "NPL";