MVC HTML helper class controllers


Enter user name
Enter user name
Enter pass word
Select gender

  • Male
  • female

Select Hobbies

  • Dancing
  • Playing

Select skills

  • C
  • C++
  • JAVA

Describe your experience



Go to sample .asp x source path of the page write the follows code in <div> tag

<table align= ‘center’ border=”2”>

<tr><td><%= HTML.label(“enter your name”)%></td>



<tr><td><%=HTML.label(“enter user name”)%></td>

<tr><td><%=HTML.textbox (“t2”)%></td>


<tr><td><%=HTML.label (”enter password”)%></td>



<tr><td><%=HTML.label(“text gender”)%></td>

<td><%=HTML.radiobutton(“gender”, ”male”)%>male

<%-HTML.radiobutton(“gender”, “female”)%>female



<tr><td><%=HTML.label(“select hobbies”)%></td>


<%=HTML.checkbox(“playing”)%>playing >



<tr><td><%=HTML.label (”select qualification”)%></td>

<td><%=HTML.dropdownlist (“CB1”)%></td>


<tr><td><%=HTML.label (”select skill set”)%></td>




<td><%=HTML.load (“describe your experience”)%></td>







Go to home controller .cs


Write the following code ---> to display the data in combo box and list box

Public action result sample ()


List <string> L1=new list <string> ();

L1.add (”SSC”);

L1.add (”10+2”);

L1.add (”Degree”);

List <string>L2=new list <string> ();

L2.add (””);

L2.add (”C”);

L2.add (””);

View data [“CB1”] =new select list (L1);

View data [“LB1”] =new select list (L2);

Return view ();




Redirecting the user request using HTML helper class:

To redirect the user request from one page to other page use action link method from HTML helper class.

Sample view


Desired to gain proficiency on ASP.Net?

Explore the blog post on ASP.Net training to become a pro in ASP.Net.

Create new view page with the name samples


Go to source part and write the following code



<h1>welcome to satya technologies</h1>

<%=HTML.actionlink (“sample view”, “sample”,”home”) %>



//<%#HTML.actionlink (

“(“sample view”, “sample”,”home”) %>

3                            3                     3

Display text        action name    controller name

2go to home controller create an action method like

Public action result sample ()


Return view ();


Go to globel. Asax file change action name

With samples and run the application

Create an action link to redirect user requires to some website

For indepth understanding click on