我有这个RadioButtonList
<asp:RadioButtonList runat="server" ID="loanTypeCheck" CssClass="pull-right" RepeatDirection="Horizontal">
<asp:ListItem Value="Cash" Text=" Cash "/>
<asp:ListItem Value="Non-Cash" Text=" Non-Cash " />
<asp:ListItem Value="Dharauti" Text=" Dharauti " />
</asp:RadioButtonList>
在我的保存按钮事件中的代码隐藏
protected void SaveButton_Click(object sender, EventArgs e)
{
if (IsFormValidForSave())
{
var loanReceipt = GetLoanReceiptFromForm();
var transactionsDetails = new List<TransactionDetail>();
var loantypeCheck = loanTypeCheck.SelectedValue;
//if (IsCashReceipt)
if (loantypeCheck == "Cash")
{
var transaction = new Transaction()
{
AuditUserId = UserId,
OfficeId = OfficeId,
VerificationStatusId = 0,
BookName = EverestEnums.TransactionBookName.LoanReceipt,
BookNameString = EverestEnums.TransactionBookName.LoanReceipt.ToString(),
TranDateString = DateConversion.GetCurrentServerDate().ToString(),
ValueDateString = ValueDateControl.ValueDateAd.ToString(),
TellerId = UserId,
TotalAmount = SubmittedAmountTextBox.Text.ToDecimal(),
ValueDate = ValueDateControl.ValueDateAd,
TranDate = DateConversion.GetCurrentServerDate(),
};
我收到单选按钮的空值。我错过了什么?