Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @using LessIsMore.Models
- @model User
- @{
- ViewBag.Title = "Welcome";
- }
- <h2>Welcome</h2>
- @using (Html.BeginForm("Welcome","Welcome",FormMethod.Post)) {
- <div class="form-group">
- <label for="txtUserName">UserName: </label>
- <input type="text" id="txtUserName" class="form-control" placeholder="UserName" />
- </div>
- <div class="form-group">
- <label for="txtPassWord">PassWord: </label>
- <input type="password" id="txtPassWord" class="form-control" placeholder="PassWord" />
- </div>
- <button type="submit" id="btnsubmit" class="btn btn-default">Submit</button>
- }
- namespace LessIsMore.Controllers
- {
- public class WelcomeController : Controller
- {
- [HttpGet]
- public ActionResult Welcome()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Welcome(User u)
- {
- //Some code here
- return View(u);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement