Skip to content

How do i bind 4 tab in a loop.

Manoj Maharana

Asked Mar 31, 2017, 7:35 AM EDT1 answer
Share
LinkedInX
How do i bind 4 tab in a loop.
  1. @foreach (var item in Model.ParentList)  
  2.                                 {  
  3.                                     
    class
    ="tab-pane active" id="tab1">  
  4.   
  5.                                         @foreach (var items in Model.ParentList)  
  6.                                         {  
  7.                                             
    class
    ="row">  
  8.   
  9.                                                 
    class
    ="form-group">  
  10.   
  11.                                                     
    class
    ="col-md-12">  
  12.   
  13.   
  14.                                                         @items.QuestionText  
  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.                                                                 
    class
    ="icheck-list">  
  23.                                                                     class="icheck-list" id="@ch.AnswerId">  
  24.   
  25.                                                                         "@ch.QuestionId" onclick="handlesClick(this);" id="@id" type="radio">@ch.AnswerText  
  26.                                                                           
  27.                                                                       
  
  •  }  
  •   
  •                                                         }  
  •   
  •  }  
  •   
  • here is for tab2,3 and 4:
    1. class="tab-pane" id="tab2">
        
    2. class
      ="tab-pane" id="tab3">
      
  • class
    ="tab-pane" id="tab4">
  •    

    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.
     
    can anyone tell me?? 

    1 Answer

    Know the answer? Post it. Somebody with the same question will find it here.