Mark Rae said:
if (Request.ServerVariables["HTTP_REFERER"] != nothing)
{
}
What language is your above code?
C#
I thought C# used null rather than nothing
....snip
How did you open the page? A page will only have a referer if it was
opened from a hyperlink...
I been playing and find that if I open the page by inserting the URL (for
Default.aspx) into IE I got "nothing"
but as I move from page to page in my pages it is "not nothing"
In my .master I've put
b>You came from URL:</b>
<% Response.Write(Request.ServerVariables("HTTP_REFERER"))%>
And it's printout agrees with what I wrote in the first section
Looks like maybe for security IIS lets me see only my own URL.
I made an index.htm containing only:
<script type="text/javascript">
window.location.href = "Default.aspx"
</script>
This produced "nothing"
Changed to
<a href="Default.aspx">Click here</a>
This produced "not nothing"
All of which agrees with your statement about opening with a hyperlink.
Except when I use IE to open Default.aspx I do not get a referer. I don't
understand that one.
Thanks for the help