开发者

Back Reference Link (link of back page)

i am using this function to get link of page which refered current page (in Back Button) :- Shared Function RefererPage() As String Return HttpContext.Current.Request.ServerVariables("HTTP_REFERER") End Func开发者_JAVA技巧tion

this function is working fine with mozilla firfox but not working with Internet Explorer (IE8) please tell me why is it not working and what to do to make it work.


use server side button instead of html button then it will work fine with IE also.


IE8 will not send the HTTP 'Referer' header if the referring page uses JavaScript to perform the navigation. See this blog post for more info.

This is also discussed in this Stack Overflow question.

In general, the 'Referer' header is not guaranteed to work. It works most of the time, but it can be disabled or spoofed. So it's best to design your app to not rely on the referrer. For example, you could put something to identify where the user is coming from in the query string of the link URL.

If you do want to use the 'Referer' header, and you control the referring page, there is a JavaScript workaround described in the blog post I mentioned above.

If you don't control the referring page (e.g. visitors are coming directly from Google), you may be out of luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜