2
Answers

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

suman goud

suman goud

8y
296
1
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)