【发布时间】:2012-06-17 03:40:49
【问题描述】:
我需要为我的打印打开一个新窗口,谁能告诉我该怎么做?
我的按钮点击代码:
我的 window.location 工作,但不能使用 window.open
$('.btnFromIndexPrint').click(function () {
if (document.URL.indexOf('index') > -1) {
// window.location = '../Print/' + $(this).attr('id');
window.open = '../Print/' + $(this).attr('id');
} else {
//window.location = 'Contract/Print/' + $(this).attr('id'); //Redirect from Index page to print action
window.open = 'Contract/Print/' + $(this).attr('id');
}
});
我的html:
我知道有一个叫做 target ="blank" id 的东西,但我认为它不会起作用。
<input type="button" value="Print" class="btnFromIndexPrint" id="@item.SalesContractId"/>
如何在新页面上打开重定向?
重要!!!!!!
return RedirectToAction("Print", new { id = contractInstance.SalesContractId });
【问题讨论】:
标签: jquery asp.net-mvc new-window