28 July 2013

HTML and HTML Helpers

These are just a list of some commonly-used HTML elements and helpers we usually use in our small projects:

<%= Html.TextBox("username") %>
<%= Html.ValidationMessage("username", "*") %>
<%= Html.Password("password") %>
<%= Html.TextArea("message", new {cols=50, rows=20})%>
<%= Html.DropDownList("sex") %>
<%= Html.ValidationSummary() %>

<label for "username"> User Name: </label>

<input type = "submit" value ="Send Message" />

<form action = "/home/create" method = "post">
</form>

<table>
 <thead>
  <tr>
   <th>
    Title
   </th>
   <th>
    Actions
   </th>
  </tr>
 </thead>
 <tbody>
  <%foreach (var x in model)
   {%>
  <tr>
   <td>
    <%=x.Name %>
   </td>
   <td>
    <a href=''>Edit</a> <a href=''>Delete</a>
   </td>
  </tr>
  <%} %>
 <tbody>
</table>

No comments:

Post a Comment