Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 469.9k

How to pull table record from the database in asp.net mvc 5?

Sep 23 2020 9:29 AM
Hi Team
 
I really need some help, i cant pull the table record from the client side, once a user click Next. Before user must first select email-address and insert fromt the textbox, thereafter be prompt when clicking next, with details such as Name, EmailAddress, LoginId, Insitution. This is what i have currently, bit stuck
  1. <div class="form-group row">  
  2.                                     <div class="col-sm-4">  
  3.                                         <input type="radio" id="EmailAddress" name="choose" />  
  4.                                         <label for="EmailAddress" class="col-form-label">EmailAddress</label>  
  5.                                     </div>  
  6.                                     <div class="col-sm-3">  
  7.                                         <input type="radio" id="LoginID" name="choose" />   
  8.                                         <label for="LoginID" class="col-form-label">LoginID</label>  
  9.                                     </div>  
  10.   
  11.                                     <div class="col-sm-3">  
  12.                                         <input type="radio" id="SIS_ID" name="choose"/>  
  13.                                         <label for="SIS_ID" class="col-form-label">SIS_ID</label>  
  14.                                     </div>  
  15.   
  16.                                     <div class="col-sm-12">  
  17.                                         @Html.TextAreaFor(m => m.eNtsaAdmin.eNtsaTextAreaDisc, new { @class = "form-control", style = "font-size: medium; font-weight: bold; width:450px", id= "eNtsaTextAreaDisc" })  
  18.   
  19.                                     </div>  
  20.                                     <hr />  
  21.   
  22.   
  23.                                 </div>  
  24.   
  25.  <div class="modal-footer">  
  26.                                 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>  
  27.                                 <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter" id="btnNext">  
  28.                                     Next  
  29.                                 </button>  
  30.                             </div>  
  31.   
  32.   
  33.   @foreach(var data in Model.regPeopleLists)  
  34.                                         {  
  35.                                               
  36.                                         }  
  37.                                         <div class="modal-body">  
  38.                                             <table class="table table-bordered">  
  39.                                                 <thead>  
  40.                                                     <tr>  
  41.                                                         <th>Name</th>  
  42.                                                         <th>EmailAddress</th>  
  43.                                                         <th>LoginID</th>  
  44.                                                         <th>SISID</th>  
  45.   
  46.                                                     </tr>  
  47.                                                 </thead>  
  48.                                             </table>  
  49.                                         </div>  
  50. <!--This functionality applies to radio button change state-->  
  51.   
  52. <script type="text/javascript">  
  53.   
  54.     $(document).ready(function () {  
  55.         $(document).ready(function () {  
  56.             // Fire when radio button clicked  
  57.             $("#LoginID, #SIS_ID").bind("change", function () {  
  58.                 checkdata();  
  59.             });  
  60.   
  61.             // Fire when we enter anything in the textbox  
  62.             $("#eNtsaTextAreaDisc").bind("input", function () {  
  63.                 checkdata();  
  64.             });  
  65.         });  
  66.   
  67.         //here we check both radio button clicked and textbox filled with some information  
  68.         function checkdata() {  
  69.             if (($("#LoginID").prop("checked") || $("#SIS_ID").prop("checked")) && $("#eNtsaTextAreaDisc").val().length > 0) {  
  70.                 $("#btnNext").removeAttr("disabled");  
  71.             }  
  72.             else {  
  73.                 $("#btnNext").attr("disabled""disabled");  
  74.             }  
  75.         }  
  76. </script>  
 

Answers (1)