-1
@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 { } 为什么我会出现此错误?

4

1 回答 1

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>
}
于 2013-06-14T19:51:13.147 回答