title: stop unauthorized file download in asp.net
body: <p>I have a <code>login.aspx</code> page with custom textbox for username and password i.e. no <code>loginview</code><br>
  after supplying correct username and pwd i assign a <code>sessionid</code> which is used to visit other  pages on website.     </p>
  
  <p>Now to download a <code>file (1234)</code> i redierct the user to <code>~/download.aspx?fileid=1234</code>, on this page i check the session id and send the user to file url i.e. <code>~/file/1234.pdf</code>.<br>
  if some one dirctly enters file url, then i am unable to stop him.<br>
  plase guide me on how to do this...    </p>
  
  <p>P.S. : i have read about <code>authentication rule</code> in <code>web.config</code> file but dont know how to mark user as authenticated ones he supplies correct username and password at login. (i am only checking username and pwd from database and redirecting to home page)</p>