如何使用目标= _blank上的Response.Redirect?如何使用、目标、_blank、Response

2023-09-03 20:25:31 作者:大步向前跨

我不一定要使用的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>");