ugrshen sharma

ugrshen sharma

  • NA
  • 4
  • 519

In the mvc-5 tab formate data save in sql but not save

Aug 4 2019 6:44 AM
In the mvc-5 we use https://www.W3schools.Com/howto/howto_js_form_steps.Asp this type of login but data not save and after one step come first step please suggest
  1. <div class="container">  
  2. <div class="row justify-content-center align-items-center">  
  3. @using (Html.BeginForm("Register""Account", FormMethod.Post, new { role = "form", id = "Register" }))  
  4. {  
  5. @Html.AntiForgeryToken()  
  6. @Html.ValidationSummary(true""new { @class = "text-danger" })  
  7. @Html.HiddenFor(model => model.PhoneNumber)  
  8. @Html.HiddenFor(model => model.Email)  
  9. @Html.HiddenFor(model => model.Password)  
  10. @Html.HiddenFor(model => model.ConfirmPassword)  
  11. @Html.HiddenFor(model => model.intTitle_ID)  
  12. @Html.HiddenFor(model => model.chrFirst_Name)  
  13. @Html.HiddenFor(model => model.chrLast_Name)  
  14. @Html.HiddenFor(model => model.DOB)  
  15. @Html.HiddenFor(model => model.chrMerital_Status_Self)  
  16. <h1 class="text-primary">Register New User</h1>  
  17. <div class="tab">  
  18. <div class="form-group">  
  19. @Html.LabelFor(model => model.PhoneNumber, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  20. <div class="col-md-12">  
  21. @Html.EditorFor(model => model.PhoneNumber, new { htmlAttributes = new { id = "PhoneNumber", name = "PhoneNumber", @placeholder = "Enter your Phone number", @class = "form-control text1" } })  
  22. @Html.ValidationMessageFor(model => model.PhoneNumber, ""new { @class = "text-danger" })  
  23. </div>  
  24. </div>  
  25. <div class="form-group">  
  26. @Html.LabelFor(model => model.Email, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  27. <div class="col-md-12">  
  28. @Html.EditorFor(model => model.Email, new { htmlAttributes = new { @placeholder = "Enter your Email", @class = "form-control text1" } })  
  29. @Html.ValidationMessageFor(model => model.Email, ""new { @class = "text-danger" })  
  30. </div>  
  31. </div>  
  32. <div class="form-group">  
  33. @Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  34. <div class="col-md-12">  
  35. @Html.EditorFor(model => model.Password, new { htmlAttributes = new { @placeholder = "Enter Password", @class = "form-control text1" } })  
  36. @Html.ValidationMessageFor(model => model.Password, ""new { @class = "text-danger" })  
  37. </div>  
  38. </div>  
  39. <div class="form-group">  
  40. @Html.LabelFor(model => model.ConfirmPassword, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  41. <div class="col-md-12">  
  42. @Html.EditorFor(model => model.ConfirmPassword, new { htmlAttributes = new { @placeholder = "Enter Confirm Password", @class = "form-control text1" } })  
  43. @Html.ValidationMessageFor(model => model.ConfirmPassword, ""new { @class = "text-danger" })  
  44. </div>  
  45. </div>  
  46. @*<div class="form-group">  
  47. @Html.LabelFor(model => model.intCountry_ID, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  48. <div class="col-md-12">  
  49. @Html.EditorFor(model => model.intCountry_ID, new { htmlAttributes = new { id = "phone", name = "phone", @class = "form-control text-dark text1" } })  
  50. @Html.ValidationMessageFor(model => model.intCountry_ID, ""new { @class = "text-danger" })  
  51. </div>  
  52. </div>*@  
  53. </div>  
  54. <div class="tab">  
  55. <div class="form-group">  
  56. @Html.LabelFor(model => model.intTitle_ID, new { @class = " col-md-6 control-label text-primary font-weight-bold " })  
  57. <div class="col-md-12">  
  58. @Html.DropDownListFor(m => m.intTitle_ID, new SelectList(Model.TitlesList, "intTitle_ID""ChrTitle_Name"), "Select Title"new { @class = "form-control text1" })  
  59. </div>  
  60. </div>  
  61. <div class="form-group">  
  62. @Html.LabelFor(model => model.chrFirst_Name, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  63. <div class="col-md-12">  
  64. @Html.EditorFor(model => model.chrFirst_Name, new { htmlAttributes = new { @placeholder = "Enter your first name", @class = "form-control text1" } })  
  65. @Html.ValidationMessageFor(model => model.chrFirst_Name, ""new { @class = "text-danger" })  
  66. </div>  
  67. </div>  
  68. <div class="form-group">  
  69. @Html.LabelFor(model => model.chrMid_Name, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  70. <div class="col-md-12">  
  71. @Html.EditorFor(model => model.chrMid_Name, new { htmlAttributes = new { @placeholder = "Enter your Middle name", @class = "form-control text1" } })  
  72. @Html.ValidationMessageFor(model => model.chrMid_Name, ""new { @class = "text-danger" })  
  73. </div>  
  74. </div>  
  75. <div class="form-group">  
  76. @Html.LabelFor(model => model.chrLast_Name, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  77. <div class="col-md-12">  
  78. @Html.EditorFor(model => model.chrLast_Name, new { htmlAttributes = new { @placeholder = "Enter your Last name", @class = "form-control text1" } })  
  79. @Html.ValidationMessageFor(model => model.chrLast_Name, ""new { @class = "text-danger" })  
  80. </div>  
  81. </div>  
  82. <div class="form-group">  
  83. @Html.LabelFor(model => model.DOB, htmlAttributes: new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  84. <div class="col-md-12">  
  85. @Html.EditorFor(model => model.DOB, new { htmlAttributes = new { @placeholder = "DD/MM/YYYY", @class = "form-control datepicker text1" } })  
  86. @Html.ValidationMessageFor(model => model.DOB, ""new { @class = "text-danger" })  
  87. </div>  
  88. </div>  
  89. <div class="form-group">  
  90. @Html.LabelFor(model => model.chrMerital_Status_Self, new { @class = "col-md-6 control-label text-primary font-weight-bold" })  
  91. <div class="col-md-12">  
  92. @Html.EnumDropDownListFor(model => model.chrMerital_Status_Self, "Select Marital Status"new { @class = "form-control text1" })  
  93. </div>  
  94. </div>  
  95. @*<div class="form-group">  
  96. @Html.LabelFor(model => model.chchrGender, new { @class = "control-label col-md-6 text-primary font-weight-bold" })  
  97. <div class="col-md-12">  
  98. @Html.RadioButtonFor(m => m.chchrGender, "Male") <span>Male</span>  
  99. @Html.RadioButtonFor(m => m.chchrGender, "Female")<span>Female</span>  
  100. @Html.RadioButtonFor(m => m.chchrGender, "Other")<span>Other</span>  
  101. </div>  
  102. </div>*@  
  103. @*<div class="form-group">  
  104. @Html.LabelFor(model => model.chrCountry_Name, new { @class = "control-label col-md-6 text-primary font-weight-bold " })  
  105. <div class="col-md-12">  
  106. @Html.DropDownListFor(m => m.chrCountry_Name, new SelectList(Model.ContryList, "chrCountry_Name""chrCountry_Name"), "Select Country"new { @class = "form-control text1" })  
  107. </div>  
  108. </div>  
  109. <div class="form-group">  
  110. @Html.LabelFor(model => model.chrState_Name, new { @class = "control-label col-md-6 text-primary font-weight-bold " })  
  111. <div class="col-md-12">  
  112. @Html.DropDownListFor(m => m.chrState_Name, new SelectList(Model.StateList, "chrState_Name""chrState_Name"), "Select State"new { @class = "form-control text1" })  
  113. </div>  
  114. </div>  
  115. <div class="form-group">  
  116. @Html.LabelFor(model => model.chrCity_Name, new { @class = "control-label col-md-6 text-primary font-weight-bold " })  
  117. <div class="col-md-12">  
  118. @Html.DropDownListFor(m => m.chrCity_Name, new SelectList(Model.CityList, "chrCity_Name""chrCity_Name"), "Select City"new { @class = "form-control text1" })  
  119. </div>  
  120. </div>*@  
  121. </div>  
  122. <br />  
  123. <div style="overflow:auto;">  
  124. <div style="float:right;">  
  125. <button type="submit" id="prevBtn" onclick="nextPrev(-1)">Previous</button>  
  126. <button type="submit" value="Register" id="nextBtn" onclick="nextPrev(1)">Next</button>  
  127. </div>  
  128. </div>  
  129. <div style="text-align:center;margin-top:40px;">  
  130. <span class="step"></span>  
  131. <span class="step"></span>  
  132. </div>  
  133. }  
  134. </div>  
  135. </div>

Answers (1)