复制地址栏中的过去网址时不要打开页面
问题描述:
你好,
我创建一个网站但是当我在特定页面中复制网址并过去地址栏时显示该页面,我如何解决此问题
hello,
I create a website but when i copy the url in particular page and past in address bar it show that page, How I resolve this problem
答
你不能通过输入地址栏中的URL来限制用户,但是你可以限制一个弹出窗口,但不能在主窗口/屏幕上限制。
因此,为了限制弹出窗口中的地址栏,你可以隐藏完整的地址栏,在window.open
函数中设置location = no
。
参考 window.open - msdn [ ^ ]了解更多。
希望它有所帮助。
Hi,
you cannot restrict user by entering the URL in address bar, but you can restrict on a popup window, but not on main window/screen.
So, for restricting address bar in popup window, you can hide the complete address bar by setting"location=no"
inwindow.open
function.
refer window.open - msdn[^] for more.
hope it helps.
try
{
String re = Request.UrlReferrer.ToString();
//code//
}
catch
{
Response.Redirect("~/abcd.aspx");
}
在页面加载部分尝试此代码...
try this code in page load part...