What is MVC HTML- Helpers and its Methods?

Category: C SharpWhat is MVC HTML- Helpers and its Methods?
Editor">Editor Staff asked 2 years ago

What is MVC HTML- Helpers and its Methods?

1 Answers
Editor">Editor Staff answered 2 years ago

the view. They provide an advantage over using the HTML elements since they can be reused across the views and also requires less coding. There are several builtin helper methods that are used to generate the HTML for some commonly used HTML elements, like form, checkbox, dropdownlist etc. Also we can create our own helper methods to generate custom HTML. First we will see how to use the builtin helper methods and then we will see how to create custom helper methods.
 
Standard HtmlHelper methods
 
Some of the standard helper methods are,

  • ActionLink: Renders an anchor.
  • BeginForm: Renders HTML form tag
  • CheckBox: Renders check box.
  • DropDownList: Renders drop-down list.
  • Hidden: Renders hidden field
  • ListBox: Renders list box.
  • Password: Renders TextBox for password input
  • RadioButton: Renders radio button.
  • TextArea: Renders text area.
  • TextBox: Renders text box.