返回重定向到新的窗口,在ASP.NET MVC? [英] Return redirect to new window in ASP.NET MVC?

查看:92
本文介绍了返回重定向到新的窗口,在ASP.NET MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想要做的就是打开一个新窗口,以用户为previewing他们已经提交了某种形式的数据。

Basically, what I'm trying to do is open up a new window to the user for previewing some form data they have submitted.

我试图用code从我的控制器做到这一点:

I'm trying to do it from my controller using the code:

返回的JavaScript(window.open('http://www.google.com'))

但它所做的是恢复一个文件下载对话框,而不是打开一个新窗口。

But all it does is return a file download dialog instead of opening a new window.

有我错过了一些东西还是我做错了完全?

Have I missed something or am I doing it wrong entirely?

在此先感谢您的帮助。

推荐答案

我已经成功地从论坛上多小时的反复试验,我自己的解决方案通过最终改变我的表单提交到这也使我$阿贾克斯后执行window.open对成功的相关网址。

I've managed to forum my own resolution from many hours of trial and error, by ultimately changing my form post to a $.ajax post which has allowed me to execute window.open to the relevant url on success.

这篇关于返回重定向到新的窗口,在ASP.NET MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆