This article will show how to add new functionality in HtmlHelperclass using Extension method. This will give step by step explanation of, how to create or add MENU functionality n Html helper class and then use that in view of ASP.Net MVC application.
Create an ASP.Net MVC application.
File->New->Project->web->ASP.Net MVC Application
Create Extension method for Html Helper class.
- Add a class to the project. Give a significant name. I am giving name MenuExtension
- Convert this class to a static class.
- This class contains two methods.