This article gives you insight into AngularJS Form helper for ASP.NET MVC.
What is meant by HTML helper?
According to MSDN, HTML helper “Supports the rendering of HTML controls in a view.” The HtmlHelper class provides the methods, which help you to create HTML controls programmatically. All HtmlHelper methods generate HTML and return the result as a string.
Generally, HTML helpers are written in C# or VB.NET (in .NET Framework) and that helps the developers to write a long HTML in short Razor code (Like @html.textbox()).
Introduction
All ASP.NET developers are familiar with HTML helper. Lots of HTML helpers (HTML strings, jQuery validation, script and style wrappers) are available online. This helper is especially designed for an AngularJS model and form validation support.
How it works
Before proceeding towards setup, let's understand how an Angular form helper works on ASP.NET Razor page. Here, a simple signup page is written in Razor using an Angular form helper. The output is rendered in Plain html with Angular validation and model attributes.
SignUp.cshtml(Razor page)
Person Model
Plain Angular/HTML code
Setup
Download project from here.
Step 1
Add AxSoft.Angular.NET project into your existing project or just add AxSoft.Angular.Net40.dll file from the zip (if you add .DLL file as the reference, please skip these steps).
Your Solution Explorer likes it.
Step 2 Build your solution and add AxSoft.Angular.Net40.dll file to your project.
Summary
HTML helper is a robust class to render HTML templates and more intellisense support. At the same time, it’s not adopted with the latest client side technologies (Angular, TypeScript). This kind of new helpers improve HTML helpers and reduce the time of the coding in plain HTML.
Programming ASP.NET MVC 5