Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. public ActionResult Index()
  2. {
  3. return View();
  4. }
  5.  
  6. [HttpPost]
  7. public ActionResult Index(LoginInfo login)
  8. {
  9. if (Request.Form["Submit"] != null)
  10. {
  11. string Username = login.Username;
  12. string Password = login.Password;
  13.  
  14. ViewBag.Massage = "";
  15.  
  16. if (Username == "Admin" && Password == "123")
  17. {
  18. ViewBag.Massage = "Login Successfull";
  19.  
  20. return RedirectToAction("MSISDN","UnSub");
  21. }
  22. else
  23. {
  24. ViewBag.Massage = "Please Enter Valid Login Information";
  25. }
  26. }
  27. return View();
  28. }
  29.  
  30. <form name="myForm" action="/Home/Index" method="post">
  31. <div align="center">
  32. <div style="color:red">@ViewBag.Massage</div>
  33. <br>
  34. <label for="Username">Username:</label>
  35. <input type="text" name="Username" id="Username">
  36. <label for="Password">Password:</label>
  37. <input type="password" name="Password" id="Password">
  38. <br>
  39. <input type="submit" name="Submit"value="Submit">
  40.  
  41. </div>
  42. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement