Question

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 Function

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top