Hi!
I used below code its working? But I have problem with value. I can't get number value I am getting letter.
namespace Loan.Enums
{
public enum RC_CREDIT_RATING
{
ZERO = 0,
NULL = 1,
A = 2,
B = 3,
C = 4,
D = 5,
E = 6,
F = 7,
G = 8,
A1 = 9,
B1 = 10,
C1 = 11,
D1 = 12,
E1 = 13,
F1 = 14,
G1 = 15,
}
}
@using Loan.Enums
@{
var RC_CREDIT_RATINGS = Enum.GetValues(typeof(RC_CREDIT_RATING)).OfType<RC_CREDIT_RATING>().Select(m => new SelectListItem { Text = m.ToString(), Value = m.ToString() }).ToList();
}
<div class="col-md-3">
<div class="form-group">
<label class="col-md-12">Рейтинги қарзӣ</label>
<div class="col-md-12">
@Html.DropDownListFor(model => model.RC_CREDIT_RATING, @RC_CREDIT_RATINGS, "Выберите", new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.RC_CREDIT_RATING, "", new { @class = "text-danger" })
</div>
</div>
</div>
I want Get value number 0, 1, 2, 3, 4 and ect.