2013-05-04 190 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