Checking Request.ServerVariables["HTTP_REFERER"] on every request
<p>I am using this code to check if the request came from a page , if not then redirect somewhere.</p>

<pre><code>string referer = Request.ServerVariables["HTTP_REFERER"];
            if (string.IsNullOrEmpty(referer))
            {
                Response.Redirect("/UnauthorizedAccess.aspx");
            }
</code></pre>

<p>It is working , I don't know whether it is perfect the solution.However I am checking this on load event of one of my page.How can I make it check on every request.Should I check this for all my pages.Also it is a good approach.Can anybody point me in the right direction.Any suggestion is welcome.</p>
