DynamicRazorView 150525
DynamicRazorView 150525
cshtml
-----------------------------------------------------------------------------------
-----------------
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<div>
UserName: @Html.TextBox("TextBox1")<br /><br />..defining the text
box
Password: @Html.Password("TextBox2")<br /><br />--defining the
password field
Address: @Html.TextArea("TextBox3")<br /><br />--defining the text
area
</div>
<div>
Hobbies:
@Html.CheckBox("Hobbies", false)Cricket ...defining a checkbox
@Html.CheckBox("Hobbies", true)Chess
@Html.CheckBox("Hobbies", false)Hockey
</div><br /><br />
<div>
Gender:
@Html.RadioButton("Gender", false)Male---defining a radio button
@Html.RadioButton("Gender", false)Female
</div><br /><br />
<div>
Country:
@Html.DropDownList("ddlCountry", new SelectList(Countrylist),
"Select");--defining the dropdown
</div> <br /><br />
<div>
<input type="Submit" value="Save">
</div>
}
</body>
</html>
-------------Homecontroller---------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVCProject01.Models;
namespace MVCProject01.Controllers
{
}
}