URL引用站点不工作的弹出窗口 [英] URL Referer not working on pop up windows
问题描述
我有两个页面分别是 www.abc.com/pg1.aspx
和 www.abc.com/pg2.aspx
I have two pages namely www.abc.com/pg1.aspx
and www.abc.com/pg2.aspx
pg1.aspx
response.redirect("www.abc.com/pg2.aspx");
pg2.aspx
string url_refer = Request.UrlReferrer.ToString();
UrlReferrer
工作正常。
pg1.aspx
<a href='#' onclick=\"window.open('www.abc.com/pg2.aspx', 'windowname2', 'width=1014, height=709, screenX=1, left=1, screenY=1, top=1, status=no, menubar=no, resizable=no, toolbar=no'); return false;\">
pg2.aspx
string url_refer = Request.UrlReferrer.ToString();
UrlReferrer
是 NULL
我GOOGLE了解决方案。但他们都不是导致我想要的解决方案。
I googled for the solution. but none of them are leading to the solution i want.
我的问题是,如果窗口是一个没有菜单栏,状态或工具栏, UrlReferrer
是 NULL
My problem is if the window is with no menubar, status or toolbar, UrlReferrer
is NULL
如果不是, UrlReferrer
的previous页面的URL。
if not, UrlReferrer
has the previous page's URL.
我也试过 url_refer = Request.ServerVariables [HTTP_REFERER]的ToString();
而不是字符串url_refer = Request.UrlReferrer.ToString ();
。
的结果是相同的。
任何解决方案?
推荐答案
我不能肯定。但我发现..
I m not sure.. but I found out..
会话不工作。
我被告知,所有会话值是一个新的网页,其中使用JavaScript的呼吁复位。
I was told that all session values are reset on a new page which is called using javascripts.
至于我的问题的替代,我用查询字符串。
As an alternate for my question, I used QueryString.
我真的逼债希望用户看到的网址,但我已经隐藏的JavaScript的URL。
I really dun want the users to see the URL but I already hide the URL with javascript.
所以,我使用的查询字符串,仪式甲肝没问题吧?
So, i hav no problem using querystring, rite?
有没有人有更好的解决方案?
Does anyone has better solution?
这篇关于URL引用站点不工作的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!