TEP , The Engineering Projects , Author Welcome! Syed Zain Nasir Mechatronics Engineer TEP , The ENgineering Projects , TEP Badge TEP , The Engineering Projects , Ratting Background 7.5 7.5/10
TEP , The Engineering Projects , Rating Percentage Background Reputation Score 55 / 100
HTML Helpers in ASP.NET MVC, helpers in asp.net mvc, html helpers in asp, helpers in mvc
TEP , The Engineering Projects , Boxes

HTML Helpers in ASP.NET MVC

TEP , THe Engineering Projects , Shares 2.5K Views
TEP , The ENgineering Projects , Reaction 40
TEP , The ENgineering Projects , Reaction 700
TEP , The ENgineering Projects , Reaction 60
TEP , The ENgineering Projects , Reaction 25
TEP , The ENgineering Projects , Reaction 60
TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest TEP , The Engineering Projects , Pintrest
Shares: 691
TEP , The Engineering Projects , PCBWAY
HTML Helpers in ASP.NET MVC, helpers in asp.net mvc, html helpers in asp, helpers in mvc
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna have a look at HTML Helpers in ASP.NET MVC. It's our 12th tutorial in ASP.NET MVC series. I know every tutorial is a new concept for you to understand but we have to cover all of them before starting working on our project in ASP.NET MVC. If you have worked on ASP.NET web forms or C# / Visual Basic projects then you must be aware of toolboxes, from where we can drag and drop our visual components like textbox, editbox, button etc. But in ASP.NET MVC applications, we don't have this luxury of drag and drop. Instead we have HTML Helper classes which are used to created these html components in ASP.NET MVC. So, let's have a look at How to use HTML Helpers in ASP.NET MVC:

HTML Helpers in ASP.NET MVC

  • HTML Helpers are simple C# classes in ASP.NET MVC, which are used to create HTML components in the run time environment.
  • HTML Helper creates a path for displaying model values (saved in SQL Databases) in respective HTML components e.g displaying name in Name Text Box.
  • We can also get values from HTML components and then save them in our database via Model. You should recall Tut # 02: What is a Model ?.
  • So, instead of drag and drop as in C# applications, in ASP.NET MVC we are generating and controlling our HTML components programmatically using HTML Helper classes.
  • There are numerous HTML Helpers are available in ASP.NET MVC but the most commonly used HTML Helpers are shown in below table:
HTML Helpers in ASP.NET MVC
Type Forced Type Description
Html.TextBox Html.TextBoxFor It creates a Text Box.
Html.TextArea Html.TextAreaFor It creates a Text Area.
Html.CheckBox Html.CheckBoxFor It creates a Check Box.
Html.RadioButton Html.RadioButtonFor Radio buttons are created using this HTML Helper.
Html.DropDownList Html.DropDownListFor Drop Down List is created with it.
Html.ListBox Html.ListBoxFor It is used to create Multi-select list box.
Html.Hidden Html.HiddenFor Hidden fields are created with it.
Password Html.PasswordFor Password text box are created with it.
Html.Display Html.DisplayFor It creates Html text.
Html.Label Html.LabelFor Labels are created here.
Html.Editor Html.EditorFor Editor is created using it.
Html.ActionLink It creates Anchor link.
  • In normal HTML language, we use html tags e.g. <a> this html tag is used for linking, but in ASP.NET MVC we use HTML Helper and HTML Helper makes it too easy to bind model data with View design.
  • For example, if we are working on simple html then we will use <a href="/Student/Click ME">Click ME</a> this code to create a link, but in HTML Helper it will be @Html.ActionLink("Click ME", "Click ME").
  • I have simply used Action Link, which will create a Link component and then I have given it a name and then action method.
  • So, when you click on it then Click ME action method will be called.
  • Open the index.cshtml file of our Student Controller. ( Recall: Tut # 6: Create a New Controller in ASP.NET MVC )
  • I have removed the extra code in this index file and have added a new HTML Link Helper, as shown in below figure:
HTML Helpers in ASP.NET MVC, helpers in asp.net mvc, html helpers in asp, helpers in mvc
  • You can see in above figure that Link Helper has two inputs, the first one is the Anchor Text of the Link, while the second one is the action method which should be called i.e. Get1().
  • Here's the video demonstration of HTML Helpers in ASP.NET MVC:
So, that was all about HTML Helpers. You must have got the idea that Html Helpers are not that difficult, in fact they are here to ease the job. Thanks for reading. Take care & have fun !!! :)
TEP , The Engineering Projects , Tags
HTML Helpers in ASP.NET MVC
helpers in asp.net mvc
html helpers in asp
helpers in mvc
TEP , The Engineering Projects , Calender Tuesday, February 12, 2019
TEP , The Engineering Projects , Calender Friday, February 8, 2019
TEP , The Engineering Projects , Comments

Write a Comment

TEP , The Engineering Projects , WordPress TEP , The Engineering Projects , Google TEP , The Engineering Projects , Twitter TEP , The Engineering Projects , Facebook TEP , The Engineering Projects , User
TEP , The Engineering Projects , Robot
TEP , The Engineering Projects , Comments Comments on ‘’ HTML Helpers in ASP.NET MVC ‘’ (0)
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Top PCB Design Service

PCBA
TEP , The Engineering Projects , JLCPCB
PCB
TEP , The Engineering Projects , JLCPCB
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Embedded Tools

ARDINO TEP , The Engineering Projects , JLCPCB
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Subscribe Now !!!

Learn Free Pro Tricks

TEP , The Engineering Projects , Mail Receive Quality Tutorials Straight in your Inbox by Submitting your Email ID Below
TEP , The Engineering Projects , Mail TEP , The Engineering Projects , Mail Shadow
TEP , The Engineering Projects , Mail Robot TEP , The Engineering Projects , Mail Robot Shadow TEP , The Engineering Projects , Mail Robot Shadow
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Engineering Books

TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for arduino $20
TEP , The Engineering Projects , Rating Stars (5.0)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for Raspberry Pi $20
TEP , The Engineering Projects , Rating Stars (3.0)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for arduino $20
TEP , The Engineering Projects , Rating Stars (4.7)
TEP , The Engineering Projects , Arduino Programming Book
SALE $20
Text Book for Raspberry Pi $20
TEP , The Engineering Projects , Rating Stars (5.0)
TEP , The Engineering Projects , TEP Robot TEP , The Engineering Projects , TEP Robot Shadow TEP , The Engineering Projects , TEP Robot Shadow
TEP , The Engineering Projects , About TEP , The Engineering Projects , About Shadow

Categories

TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K
TEP , The Engineering Projects , Arduino
TEP , The Engineering Projects , Notification 20K
TEP , The Engineering Projects , Tick 900
TEP , The Engineering Projects , Views 900
TEP , The Engineering Projects , Comments 20K