Manoj Maharana

Manoj Maharana

  • NA
  • 362
  • 128.5k

How do i bind 4 tab in a loop.

Mar 31 2017 11:35 AM
How do i bind 4 tab in a loop.
  1. @foreach (var item in Model.ParentList)  
  2.                                 {  
  3.                                     <div class="tab-pane active" id="tab1">  
  4.   
  5.                                         @foreach (var items in Model.ParentList)  
  6.                                         {  
  7.                                             <div class="row">  
  8.   
  9.                                                 <div class="form-group">  
  10.   
  11.                                                     <div class="col-md-12">  
  12.   
  13.   
  14.                                                         <label>@items.QuestionText</label>  
  15.   
  16.                                                         @foreach (var ch in Model.ChildList)  
  17.                                                         {  
  18.                                                             if (items.QuestionId == ch.QuestionId)  
  19.                                                             {  
  20.                                                                 string id = @ch.QuestionId + "_" + @ch.AnswerId;  
  21.   
  22.                                                                 <div class="icheck-list">  
  23.                                                                     <label class="icheck-list" id="@ch.AnswerId">  
  24.   
  25.                                                                         <input name="@ch.QuestionId" onclick="handlesClick(this);" id="@id" type="radio">@ch.AnswerText  
  26.                                                                         <span></span>  
  27.                                                                     </label>  
  28. </div>  
  29.  }  
  30.   
  31.                                                         }  
  32. </div></div></div>  
  33.  }  
  34. </div>  
here is for tab2,3 and 4:
  1. <div class="tab-pane" id="tab2"></div>  
  2. <div class="tab-pane" id="tab3"></div>  
  3. <div class="tab-pane" id="tab4"></div>  
 

the same code for tab2 and 3 and 4. in 4 there is a button.

i have 3 tab.(i.e. in first tag 4 questions,in next 2 tab 4 questions and 3 tab 2 questions)

Model.ParentList i got 10 questions. in Model.ChildList i got 50 answer as 10 questions and each quest having 5 choice.
i have using this themes.
http://keenthemes.com/preview/metronic/theme/admin_1/form_wizard.html
 
can anyone tell me?? 

Answers (1)