简体   繁体   English

是否可以在不更改请求 Url 的情况下重新加载页面 Url?

[英]Is it possible to reload page Url without change request Url?

I have a page with a button that if clicked on it, a function is called that creates a pdf and it is opened in a new tab.我有一个带有按钮的页面,如果单击它,则会调用一个函数来创建 pdf 并在新选项卡中打开它。 Now after clicking this button, I want to reload the current page then pdf file open in a new window.现在单击此按钮后,我想重新加载当前页面,然后在新窗口中打开 pdf 文件。 How can I do this action without change request url?如何在不更改请求 url 的情况下执行此操作?

I try to use below code but it change the url of new tab:我尝试使用以下代码,但它更改了新标签的网址:

if (Request.UrlReferrer != null) Response.Redirect(Request.UrlReferrer.ToString()); if (Request.UrlReferrer != null) Response.Redirect(Request.UrlReferrer.ToString());

I think you can use a simple JavaScript to reload current page completely我认为您可以使用简单的 JavaScript 来完全重新加载当前页面

Have a look at this answer:看看这个答案:

How to reload a page using JavaScript如何使用 JavaScript 重新加载页面

您可以使用 Request.UrlReferrer.ToString()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在同一时间返回View时是否可以更改URL? 那没有重定向? - Is it possible to change URL when returning View in the same time ? That is without redirecting? 是否可以在asp.net中的Page_Load上更改WebPage的URL? - Is it possible to change the url of WebPage on Page_Load in asp.net? 如果没有ajax请求或网址更改,网站中的数据如何更改? - How is data in a site change without ajax request or url changed? 我们可以更改页面内容而不更改url吗? - Can we change the content of the page without changing the url? 哪种技术可以在不更改URL的情况下更改页面内容? - What technology allows page content to change without changing the URL? url重写没有页面名称 - url rewriting without page name 如果页面请求来自不同的 URL,如何获取页面 URL? - How to get the page URL if the page request is made from a different URL? 将哈希值添加到当前网址,而无需在C#中重新加载 - Add hash to the current url without reload in c# 是否可以在不使用C#asp.net离开或重新加载页面的情况下替换浏览器的URL? - Is it possible to replace the browser's URL without leaving or reloading the page using C# asp.net? 是否可以在编译时更改Web参考URL - Is it possible to change a web reference URL at compile time
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM