top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How will you call a JavaScript function on the change of dropdownlist in ASP.NET MVC?

0 votes
435 views
How will you call a JavaScript function on the change of dropdownlist in ASP.NET MVC?
posted Sep 6, 2016 by Sathyasree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

-Suppose we are having a Dropdown for Employees list.

-Create a java-script function:

-Call this function from a dropdown as described below.

<%:Html.DropDownListFor(x => x.SelectedEmployee, new SelectList(Model.Employees, "Value", "Text"), "Please Select a Employee", new { id = "ddlEmployees", onchange="employeeSelected()" })%> 

-In this way we can call a JavaScript function on the change of dropdownlist in ASP.NET MVC.

answer Sep 8, 2016 by Shivaranjini
...