System.NullReferenceException: Object reference not set to an instance of an object.. : <p>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>

<blockquote>
  <p>System.NullReferenceException: Object reference not set to an instance of an object.</p>
</blockquote>

<pre><code>    contentpath = Server.MapPath("Message/" + rnd.Next() + contentfile.FileName);
    contentfile.PostedFile.SaveAs(contentpath);

    message = TextBox1.Text;     
</code></pre>
