Asp.net MVC 6 supports injecting service to view using a class.
Example :- When country combo box value get changed , region com
Only restriction is that class should be
1. Create a Asp.Net Project in Visual Studio 2015
2. Create a folder name services and add a service class.
2. Create a View to show Employee statistics and add the inject statement to the top of the file.
3. Call the service as below
4. Register the
EmployeeService class in the Startup.cs file.
5. Add a action method in HomeController.cs
6.Run your code you will see the output as below.
Happy Coding !!