public class User
{
public string username{get;set:}
public string password {get;set}
}
-- model
--View
@model yourproject.Models.User
@Html.TextBoxFor(m => m.username);
@Html.TextBoxFor(m => m.password );
--controller
public ActionResult UserName(User obj)
{
ViewData["a"] = "User Name is :-" + obj.username; ;
return View();
}