1

通过使用以下代码,我可以在新窗口中打开它。但我想在同一个窗口或选项卡中打开

@Html.ActionLink( "Edit", "Edit", new { id=item.studentID },new {target="_blank"}) 
4

2 回答 2

2
new {target="_blank"}

上面的代码强制该表单在新窗口中打开。要强制表单在同一窗口中打开,您需要删除 target = _blank。
所以更新后的代码看起来像这样:

@Html.ActionLink( "Edit", "Edit", new { id=item.studentID }, null )
于 2013-06-10T10:47:46.060 回答
0

替换{target="_blank"}{target="_self"},此 URL 替换当前页面。

编辑:要作为弹出窗口打开,请指定您选择的宽度和高度。

@Html.ActionLink( "Edit", "Edit", new { id=item.studentID },null, new { @style= "width:100px; height:50px"})
于 2013-06-10T10:50:52.673 回答