suman goud

suman goud

  • NA
  • 176
  • 51.6k

How to bind data to to text box on drop down change in mvc 4

Aug 19 2016 3:33 AM
How can i write dropdown change event in mvc
 
iam binding list of accounts in dropdown , when i select particular account i want to show amount of that account in textbox
 
where can i write dropdown change event in mvc
 
view
 
@Html.DropDownList("ddlAccount", Model.CustomerListModel, new { @style = "width:150px;height:22px;", @id = "ddlCustomer" }) 
 
Account Balance @Html.TextBox("AccountBalance", Model.TotalAmount, new { @class = "input-large" })
 
 
controller
 
var TotalAmount = db.Transaction_PaymentDetails.Select(m => m.Amount).Sum(); 
 i want to bind this TotalAmount  to text box on drop down change

Answers (2)