
Step 2:Select 'InternetApplication' From the template and 'Razor' as a view engine.Click OK.

Step 3.Modify the Index.cshtml as below so that it looks like simple and run it.

Step 4. Once Run, It should looks like below...

HTML Helper : HTML helpers are an easy way to render the appropriate HTML markup in a view and returns an HTML-encoded string of the type MvcHtmlString(i.e already HTML-encoded) and and therefore should not be encoded again. Example : In the Index.cshtml, you can add HTML Helpers @Html.TextBox and @Html.CheckBox like below .
@{
ViewBag.Title = "Home Page";
}
@section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
<h2>@ViewBag.Message</h2>
@Html.TextBox("myTextbox")
@Html.CheckBox("myCheckbox")
</hgroup>
</div>
</section>
}
Standard HTML Helpers :
Form Extensions —
-
Html.BeginForm()
-
Html.BeginRouteForm()
-
Html.EndForm()
Input Extensions —
-
Html.CheckBox()
-
Html.Hidden()
-
Html.Password()
-
Html.RadioButton()
-
Html.TextBox()
TextArea Extensions —
- Html.TextArea()
-
Html.Label()
Link
Extensions —
-
Html.ActionLink()
-
Html.RouteLink()
Select Extensions —
-
Html.DropDownList()
-
Html.ListBox()
Validation Extensions —
-
Html.Validate()
-
Html.ValidationMessage()
-
Html.ValidationSummary()
No comments:
Post a Comment