Q:

Block page from being viewed if not from redirect in ASP.NET/C#

I have created a page that loads a page based on an ID you pass from a previous page. However, I don't want someone to be able to just enter the .aspx page manually into the address bar. I only want the user to be able to view this page if they clicked the button that got them there. I have heard of Document.Referrer, but I am not using any Javascript in my pages and this does not provide enough security. Are there any built-in functions or tricks to achieve this?
Thanks in advance!

A:

I would look at the cross page post: 
http://msdn.microsoft.com/en-us/library/ms178139(v=vs.90).aspx
Specifically you can check for it: (FROM MSDN): 
if(PreviousPage != null)
{
    if(PreviousPage.IsCrossPagePostBack == true)
    {
         Label1.Text = "Cross-page post.";
    }
}
else
{
    Label1.Text = "Not a cross-page post.";
}

