Y G

Y G

  • NA
  • 236
  • 30.2k

Asp.net mvc dropdownlistfor onchange event

Jul 6 2017 3:19 AM
List<Saras.SIMS.BehaviorMgmt.Entity.AchievementTypes> records = (from rcd in entity.AchievementType
where rcd.OrganizationID == orgid && rcd.RecordState == 0
select new Saras.SIMS.BehaviorMgmt.Entity.AchievementTypes
{
AchievementTypeId = rcd.Id,
Name = rcd.Name,
Points = rcd.Points
}).ToList();
 
 
I am returning this list to view as Model.AchievementTypes 
 
<div class="col-xs-12 bottom20">
<div class="col-xs-12 subfont themecolor">Achievement type</div>
<div class="col-xs-12 mainfont">
@Html.DropDownListFor(m => m.AchievementTypeId, new SelectList(Model.AchievementTypes, "AchievementTypeId", "Name"), new { style = "width:100%" })
</div>
</div>
<div class="row">
<div class="col-xs-4 bottom20">
<div class="col-xs-12 subfont themecolor">Weightage points</div>
<div class="col-xs-12 mainfont">
@Html.ExcelTextBox(m => m.Weightage, new TextBoxAttributes().SetMaxlength("5").SetCheckSpecialCharacters("True").SetReadOnly(false).SetCssClass("form-control"))
</div>
</div>
 
 
Now Onchange of AchievementType I want to bind the Points Value present in Model.AchievementTypes to Weightage
 
 
Can any one please suggest me how to do it. 
 
 
 

Answers (1)