在mvc 3中的window.opener [英] window.opener in mvc 3
本文介绍了在mvc 3中的window.opener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想知道如何使用javascript中的window.opener打开在razor框架中创建的页面.
Paige
Hi Guys,
I wanna know how does one open the page created in razor framework using the window.opener in javascript.
Paige
推荐答案
You could use a normal link with target="_blank" attribute:
@Html.ActionLink(
"Generate PDF",
"GeneratePdf",
"MyController",
null,
new {
url = "some url",
target = "_blank"
}
)
or if you want a button you could use javascript in separate JS file you can use Jquery:
(function(){
(function() {
(' #btnID').click(function(){ // 获取按钮的data-pdf-url属性的URL var url =
('#btnID').click(function() { // get the url of the data-pdf-url property of the button var url =
这篇关于在mvc 3中的window.opener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文