You have no right to prevent the user from typing the URL and loading a page, nor you have any control over it. And this is good. You could understand it if you analyzed how Web works.
If you explain the purpose of your question, you might get a useful advice, depending on what is that purpose.
[EDIT]
Instead of having this pointless task, you can do something more reasonable. For exactly, one the server side you can check up the referral and generate some essential context if you find the referral is legitimate and do something else if it is not, for example, redirect to error page. Please see:
http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer.aspx[
^].
—SA