top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

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

0 votes
113 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
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...