如何使用目标= _blank上的Response.Redirect? [英] How do I use Target=_blank on a response.redirect?

查看:136
本文介绍了如何使用目标= _blank上的Response.Redirect?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不一定要使用的Response.Redirect,但这就是我。我想开一个新的窗口中选中的链接。我该怎么办呢?

  context.Response.Redirect(ConfigurationManager.AppSettings [网址] +分机);
 

解决方案

您不能是简单的答案。该浏览器,可以打开一个新窗口的唯一的事。

你可以做的就是发送HTML下一个与您的URL作为一个href链接响应的一大块,目标=_空白,而假货点击表格的JavaScript的onload的一大块。如果不工作,然后使用的window.open(URL);

 的Response.Write(<脚本>中);
回复于(的window.open('page.html即可','_空白'));
回复于(< / SCRIPT>中);
 

I do not necessarily have to use response.redirect, but that is what I had. I would like to open the selected link in a new window. How do I do that?

context.Response.Redirect(ConfigurationManager.AppSettings["URL"] + ext );

解决方案

You can't is the short answer. The browser is the only thing that can open up a new window.

What you can do is send a chunk of html down the response that has a link with your url as an href, target="_blank" and a chunk of javascript onload of the form that fakes a click. If this doesn't work then use a window.open(url);

response.write("<script>");
response.write("window.open('page.html','_blank')");
response.write("</script>"); 

这篇关于如何使用目标= _blank上的Response.Redirect?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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