如何在target = _blank新页面中使用模型RedirectToAction? [英] How can I RedirectToAction with model in a target=_blank new page?
问题描述
我想弹出一个新的空白页以确认用户输入。但我怎么能这样做?
我想做类似下面的事情:
I want to pop-up a new blank page to confirm user input. But how can I do it?
I want to do something like below:
RedirectToAction("ConfirmPage", model, new { taget = "_blank" });
但它会出现语法错误。
此外,我如何设置弹出窗口的大小?
谢谢。
But it will get syntax error.
And also, how can I set up the size of the pop-up window?
Thanks.
推荐答案
错误是RedirectToAction没有RedirectToAction(字符串,对象,对象)
the error is RedirectToAction didn't have RedirectToAction(string , object, object)
是的,因为它没有那个过载。
列出了所有重载 - 控制器。 RedirectToAction方法 [ ^ ]。使用适合您的方案的那个。
Yes, because it does not have that overload.
All the overloads are listed - Controller.RedirectToAction Method[^]. Use the one appropriate to your scenario.
在视图的javascript中:
点击提交
in the view's javascript:
when click submit
(' #btnSubmit')。点击(< span class =code-keyword> function (){
document .getElementById(' form1')。submit();
window .open( / Booking / ConfirmBooking,' _ blank',' left = 100,top = 100,width = 400,height = 300,toolbar = 1,resizable = 1');
});
('#btnSubmit').click(function () { document.getElementById('form1').submit(); window.open("/Booking/ConfirmBooking", '_blank', 'left=100,top=100,width=400,height=300,toolbar=1,resizable=1'); });
然后它会在点击后打开一个窗口,但在控制器绑定后显示数据。
Then it will open a window after click, but show data after controller binding.
>
这篇关于如何在target = _blank新页面中使用模型RedirectToAction?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!