我是 asp.net mvc 的新手。我的页面上有一个按钮。单击该按钮时,我只想显示下载对话框。我不想调用任何其他视图和控制器。每当我使用@Html.BeginForm("Index", "Download", FormMethod.Post)
时,它都会打开新窗口以及下载对话框。我不想打开任何新窗口。我的代码如下
@Html.BeginForm("Index", "Download", FormMethod.Post)
{
@{if (check.CheckName != "Total")
{
<td colspan="2" align="right">
<span class="button">
<input type="submit" value="View Report" class="form_button" onclick="window.showModalDialog('/Download/Index?EmployeeID=@Model.EmployeeInformation.EmployeeID&RequestID=@Model.RequestInformation.RequestID','Download View','dialogHeight:4px;dialogWidth:4px;');" /></span>
</td>
<td colspan="2" align="left">
<span class="button">
<input type="submit" value="Download Report" class="form_button" /></span>
</td>
}
}
有没有办法做到这一点?