It's already been mentioned that you can't really spoof things. But to clarify, the HTTP_REFERER header is generated by the browser, so on the server side of things you can't control it (including things handing off javascript, which may or may not be enabled).
If you just want to test the response of your page to certain headers (like "Referer:"), you can use command-line tools like curl or wget which are available in most BSD and Linux variants (including OS/X). If you're using MS Windows, you can get curl or wget using Cygwin.
wget -O - --referer="http://example.com/some/path" http://example.com/
or
curl -e "http://example.com/some/path" http://example.com/
But your core reason for doing this is apparently to "protect" a page, I think. If you really want to make sure that a page (call it "B") is only visited after some other page ("A") is visited first, then you need more complex logic on the server side.
If you're storing a session cookie, then you can embed some logic on page "A" that sets a boolean variable. Then add logic on page "B" that checks to make sure the variable has been set.
I'll leave it as an exercise for the reader to figure out how to do this in ASP.NET. (Because I'm a PHP programmer. ;-] )