嗨我有一個問題是可能有功能來顯示我的表後按下按鈕,因爲現在它總是在?我嘗試過一些中頻功能,但他們沒有工作。 我的代碼:MVC:按下按鈕後顯示錶
@using (Html.BeginForm("Search", "Home", FormMethod.Post))
{
<br />
<span style="font-weight: bold">Tytuł filmu:</span> @Html.TextBox("VideoName")
<input type="submit" value="Szukaj" class="btn-primary" />
<br />
<br />
<table cellpadding="0" cellspacing="0">
<tr>
<th>
@Html.DisplayNameFor(model => model.ImageUrl)
</th>
<th>
@Html.DisplayNameFor(model => model.VideoName)
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.ImageUrl)
</td>
<td>
@Html.DisplayFor(modelItem => item.VideoName)
</td>
</tr>
}
</table>
}
所以,你想一個表單提交的結果加載到同樣的看法?提交後,原始表單也在同一頁面上? – Jasen
是的,這一切都發生在一個視圖 – mariie