Harish Batchu

Harish Batchu

  • NA
  • 255
  • 69.7k

I Have an Issue MVC project In view,? I will explain in

Oct 6 2018 9:24 PM
#MVC,#WebDevelomoent
 
I have an view but it's not strongly typed view. Firstly i dsigned a view in the view i have panel in that i have two dive forms id in their 1st one having login and 2nd once having registration but in their i user @url.action html helper. it's working only for registraion only i have controller with methods definatinos of each one. I will share the code now
 
Please slove this issue has early as possible thanking you
  1. <div class="panel panel-login">  
  2. <div class="panel-heading">  
  3. <div class="row">  
  4. <div class="col-xs-6">  
  5. <a href="#" class="active" id="login-form-link">Login</a>  
  6. </div>  
  7. <div class="col-xs-6">  
  8. <a href="#" id="register-form-link">Register</a>  
  9. </div>  
  10. </div>  
  11. <hr>  
  12. </div>  
  13. <div class="panel-body">  
  14. <div class="row">  
  15. <div class="col-lg-12">  
  16. <form id="login-form" action="" method="post" role="form" style="display: block;">  
  17. <div class="form-group">  
  18. <div class="form-group">  
  19. @Html.TextBoxFor(m => m.Email, new { placeholder = "Enter Your Name", @class = "form-input", @tabindex = "1" })  
  20. </div>  
  21. @*<input type="text" name="username" id="username" class="form-control" tabindex="1" placeholder="Username" value="">*@  
  22. </div>  
  23. <div class="form-group">  
  24. @Html.TextBoxFor(m => m.Password, new { placeholder = "Enter Your Name", @class = "form-input", @tabindex = "1" })  
  25. @*<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">*@  
  26. </div>  
  27. <div class="form-group">  
  28. <div class="row">  
  29. <div class="col-sm-6 col-sm-offset-3">  
  30. <input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In" onclick="@Url.Action("Register","Home")">  
  31. </div>  
  32. </div>  
  33. </div>  
  34. <div class="form-group">  
  35. <div class="row">  
  36. <div class="col-lg-12">  
  37. <div class="text-center">  
  38. <a href="" tabindex="5" class="forgot-password">Forgot Password?</a>  
  39. </div>  
  40. </div>  
  41. </div>  
  42. </div>  
  43. </form>  
  44. <form id="register-form" action="" method="post" role="form" style="display: none;">  
  45. <div class="form-group">  
  46. @Html.TextBoxFor(m => m.Uname, new { placeholder = "Enter Your Name", @class = "form-input", @tabindex = "1" })  
  47. @*<input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Email Address" value="">*@  
  48. </div>  
  49. <div class="form-group">  
  50. @Html.TextBoxFor(m => m.Email, new { placeholder = "Enter Your Email", @class = "form-input", @tabindex = "2" })  
  51. @*<input type="email" name="email" id="email" tabindex="1" class="form-control" placeholder="Email Address" value="">*@  
  52. </div>  
  53. <div class="form-group">  
  54. @Html.TextBoxFor(m => m.Password, new { placeholder = "Enter Your Password", @class = "form-input", @tabindex = "3" })  
  55. @*<input type="text" name="mobilenumber" id="mobilenumber" tabindex="1" class="form-control" placeholder="Phone Number" value="">*@  
  56. </div>  
  57. <div class="form-group">  
  58. @Html.TextBoxFor(m => m.Cpassword, new { placeholder = "Enter Your Confirm Password", @class = "form-input", @tabindex = "4" })  
  59. @*<input type="password" name="password" id="password" tabindex="2" class="form-control" placeholder="Password">*@  
  60. </div>  
  61. <div class="form-group">  
  62. @Html.TextBoxFor(m => m.Mobile, new { placeholder = "Enter Your Mobile Number", @class = "form-input", @tabindex = "5" })  
  63. @*<input type="password" name="confirm-password" id="confirm-password" tabindex="2" class="form-control" placeholder="Confirm Password">*@  
  64. </div>  
  65. <div class="form-group">  
  66. <div class="row">  
  67. <div class="col-sm-6 col-sm-offset-3">  
  68. <input type="button" value="Register Now" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" onclick="location.href='@Url.Action("Register","Home")'" />  
  69. </div>  
  70. </div>  
  71. </div>  
  72. </form>  
  73. </div>  
  74. </div>  
  75. </div>  
  76. </div>  
and have home contoller with
  1. public ActionResult Register()  
  2. {  
  3. return View("WhyUs");  
  4. }  
  5. public ActionResult Login()  
  6. {  
  7. return View("InvestmentCorner");  
  8. }  

Answers (1)