I am basically trying to design a controller action that will return a file if accessed on a page but won't if someone tried to go directly to the URL or hotlink it.
I saw something like this, but it didn't work for me C# 4
Page page = HttpContext.Current.Handler as Page;
if (page != null)
{
// Use page instance.
}
I also tried using HttpContext.CurrentHandler, but with no luck either. Any help you could give would be appreciated.