@if (ViewData["Ay"] == "1")
{
<tr id="Ocak">
<td><b>Ocak</b></td>
@using (Html.BeginForm("ButcePlanlama", "Para"))
{
<td>@Html.TextBoxFor(s => s.Kira, new { style = "width: 55px; height: 15px;" })</td>
<td>@Html.TextBoxFor(s => s.Gida, new { style = "width: 55px; height: 15px;" })</td>
<td><input type="submit" value="Kaydet"></input></td>
}
<td>@Html.ActionLink("İstatistik", "İstatistik")</td>
}
因为使用if { }
而出错
为什么会出现这个错误?
答案 0 :(得分:2)
您缺少关闭表格行(</tr>
)标记:
@if (ViewData["Ay"] == "1")
{
<tr id="Ocak">
<td><b>Ocak</b></td>
@using (Html.BeginForm("ButcePlanlama", "Para"))
{
<td>@Html.TextBoxFor(s => s.Kira, new { style = "width: 55px; height: 15px;" })</td>
<td>@Html.TextBoxFor(s => s.Gida, new { style = "width: 55px; height: 15px;" })</td>
<td><input type="submit" value="Kaydet"></input></td>
}
<td>@Html.ActionLink("İstatistik", "İstatistik")</td>
</tr>
}