2013-05-04 186 views
0

我已經在for循環:問題在MVC剃刀

@foreach (var ObjCompanyContact in (List<BalCentral.DataModel.VisaCaseDestinationCountryEmploymentContact>)ViewData["VisaCaseDestinationCountryEmployment"]) 
            { 
             <table class="email_phone" style="width:100%"> 
               <thead> 
               <tr> 
                <th></th> 
                <th><label class="control-label-superscript">Primary?</label></th> 
                <th></th> 
               </tr> 
               </thead> 

             <tr> 
             <td>@*<input type="text" id="Text22" class="span4" placeholder="Email Address" value="[email protected]">*@ 

              @Html.TextBox("Email",ObjCompanyContact.Email,new {@class="span4",@placeholder="Email Address"}) 
             </td> 
             <td style="text-align:center"> 
              <input type="checkbox" name="Email"/></td> 
             <td><a href="#" class="btn"><i class="icon-remove"></i></a></td> 
             </tr> 
             <tr> 
             <td><input type="text" id="Text21" class="span4" placeholder="Email Address" value="[email protected]"></td> 
             <td style="text-align:center"><input type="checkbox" /></td> 
             <td><a href="#" class="btn"><i class="icon-remove"></i></a></td> 
             </tr> 
             <tr style="background-color: #F0F0F0 "> 
             <td colspan="3" style="padding: 5px 0px 0px 10px; "><label class="help-block" style="margin-bottom: 0px"">Add Email Address:</label></td> 
             </tr> 
             <tr style="background-color: #F0F0F0 "> 
             <td><input type="text" id="Text23" class="span4" placeholder="Add Email Address"></td> 
             <td style="text-align:center"><input type="checkbox" /></td> 
             <td><a href="#" class="btn btn-info"><i class="icon-plus"></i></a></td> 
             </tr> 

             </table> 

            } 

問題ID,它說的for循環缺少閉幕tags.After檢查幾次我沒能找出問題。感謝您的幫助。

+0

你有沒有試過把你的包裝裏的html包裝到? – rpgmaker 2013-05-04 06:44:52

+0

是的......包裝表格標籤完全關閉。但問題仍然相同 – Abhishek 2013-05-04 06:46:40

+0

你有一個額外的「在線」'可能導致解析器關閉。 – shakib 2013-05-04 06:52:02

回答

1

更新以下行從

<td colspan="3" style="padding: 5px 0px 0px 10px; "><label class="help-block" style="margin-bottom: 0px"">Add Email Address:</label></td> 

  <td colspan="3" style="padding: 5px 0px 0px 10px;"> 
      <label class="help-block" style="margin-bottom: 0px"> 
       Add Email Address:</label> 
     </td> 

格式良好,並修復您的問題,在運行時檢查過。

+0

謝謝先生,它解決了這個問題。 – Abhishek 2013-05-06 09:34:43