Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Index()
- {
- return View();
- }
- [HttpPost]
- public ActionResult Index(LoginInfo login)
- {
- if (Request.Form["Submit"] != null)
- {
- string Username = login.Username;
- string Password = login.Password;
- ViewBag.Massage = "";
- if (Username == "Admin" && Password == "123")
- {
- ViewBag.Massage = "Login Successfull";
- return RedirectToAction("MSISDN","UnSub");
- }
- else
- {
- ViewBag.Massage = "Please Enter Valid Login Information";
- }
- }
- return View();
- }
- <form name="myForm" action="/Home/Index" method="post">
- <div align="center">
- <div style="color:red">@ViewBag.Massage</div>
- <br>
- <label for="Username">Username:</label>
- <input type="text" name="Username" id="Username">
- <label for="Password">Password:</label>
- <input type="password" name="Password" id="Password">
- <br>
- <input type="submit" name="Submit"value="Submit">
- </div>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement