0
다소 특이한 문제가 있습니다. 다음과 같은 형식의 테이블에 의존하는 뷰 구조가 있습니다.아무 이유없이 빈 td 태그가 나타납니다.
<table class="smartTable">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.Case_Status, new { @id = "caseStatus", @Value = "In Progress", @readonly = "true", htmlAttributes = new { @class = "form-control" } })
<tr>
<td width="33.33%">
<div class="form-group">
@Html.LabelFor(model => model.Job_Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Job_Name, new { htmlAttributes = new { @class = "form-control" } })
<br />
@Html.ValidationMessageFor(model => model.Job_Name, "", new { @class = "text-danger" })
</div>
</div>
<td>
<td width="33.33%">
<div class="form-group">
@Html.LabelFor(model => model.Package_Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Package_Name, new { htmlAttributes = new { @class = "form-control" } })
<br />
@Html.ValidationMessageFor(model => model.Package_Name, "", new { @class = "text-danger" })
</div>
</div>
<td>
<td width="33.33%">
<div class="form-group">
@Html.LabelFor(model => model.Server_Name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="dropdown">
@Html.DropDownListFor(model => model.Server_Name, (IEnumerable<SelectListItem>)ViewBag.SrvNames, "Pick an option")
<br />
@Html.ValidationMessageFor(model => model.Server_Name, "", new { @class = "text-danger" })
</div>
</div>
</td>
</tr>
</table>
저는 테이블이 여러 개 있습니다 (형식을 변경하고 싶지 않습니다). 문제는 내보기가로드 될 때 이미 코드에 넣은 <td>
3 개 사이에 빈 태그 <td>
이 있다는 것입니다. 왜 테이블과 idk 중 두 개만 발생합니다.
누군가가 그런 이상한 행동을 일으키는 이유를 알고 있습니까?
추신 : 내 사이트의 이전 버전은이 문제가 없습니다. 테이블 구조를 엉망으로 만들 jQuery가 없습니다.
난 정말 당신이 말하려고하는 것을 얻을 수 없습니다. 내가 볼 수있는 유일한 차이점은과 no
태그가 없다는 것입니다. 어떤거야? 내가 그들을 지울 수 없다면 어떻게해야합니까? – GeorgiG
SelectListItem 태그를 끝내기 만하면됩니다.
@Html.ValidationMessageFor(model => model.Server_Name, "", new { @class = "text-danger" })
SelectListItem은 태그가 아니며 C# 논리로 캡슐화됩니다 (@는 C# 참조). 이것은 특정 C# 유형에 대한 캐스트의 일부이며 html 구조를 따를 필요가 없습니다. – GeorgiG