[英]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:看看这个答案:
您可以使用 Request.UrlReferrer.ToString()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.