English 中文(简体)
请求。 Url Referer in IE7
原标题:Request.UrlReferrer not working in IE7
  • 时间:2012-01-13 16:40:48
  •  标签:
  • c#
  • c#-4.0

我有以下法典:

if (Request.UrlReferrer != null)
        {
            if (Request.UrlReferrer.PathAndQuery.ToLowerInvariant() == "/test/content.htm")
            {
                postbacklink = Request.UrlReferrer.AbsoluteUri.Replace("/TEST/Content.htm", "/Testing.aspx?")  + Request.QueryString;
            }
            else
            {
                postbacklink = Request.UrlReferrer.AbsoluteUri;
            }
        }
        ExtendedLoanView.PostbackLink = postbacklink;

现在,可以有两个不同地点进入这一网页。 这就意味着:

 postbacklink = Request.UrlReferrer.AbsoluteUri.Replace("/TEST/Content.htm", "/Test.aspx?")  + Request.QueryString;

只能用一页(试验.aspx)开展工作,而且很难编码。 因此,见E7请求。 乌尔尔·雷杰尔告诉我:

Request.UrlReferrer = {http://Testing:12345/PPP/Content.htm}

Whereas in IE8+ I am getting this value:

Request.UrlReferrer = {http://Testing:12345/PPP/TestingPage.aspx?Name=Xyz&Address=123 YYY

我如何解决这一问题? 在过去一个月里,我一直在 Its。

最佳回答

我肯定会建议不要根据请求提供信息(而不是超出用户输入数值)来判断你的逻辑。 其实,它在浏览器上有所不同,而且确实是可笑的。

如果你仍然需要从客户向服务器传递信息,确保这些信息得到验证。 如果你需要这些人员,并掌握有效信息,不依赖浏览器给你的东西,而是把它从你提出的要求中的位置(例如,隐蔽的投入、控制、观察国的变数,或允许使用的技术)。

大部分地点都处理你试图通过将URL的目的地移至URL本身而重新解决的情况。 例如:

rel=“nofollow”http://www.example.com/login.aspx?returnUrl=/TEST/content.htm

http://www.un.org。 我确实认识到,你向客户寄送的所有物品都是非常可笑的,但如果你确定是可笑的,那么你就更容易证实其已经 t过。 例子之一是国家观点验证方法。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签