I am trying to get the file upload application described on pages 284-285 in Karl Moore's Visual Basic.Net The Tutorials to work.
At first I was getting the error message: The base class included the filed Form1 but its type (System.WebUI.HtmlControl.HtmlInputFile is not compatible with the type of control (System.Web.UI.HtmlControls.Htmlform.
I finally fixed that and now I'm getting:

Object variable or With block variable not set.
Description: 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.

Exception Details: System.NullReferenceException: Object variable or With block variable not set.
Source Error:
Line 21: 'Put user code to initialize the page here
Line 22: Dim NameOfFieldFieldElement
Line 23: NameOfFieldFieldElement.Posted.SaveAs(MyFile.PostedFIle.FileName)
Line 24: End Sub

The HTML in webform.aspx is:

<form id="Form1" method="post" encTYpe="multipart/form-data" runat="server">
<INPUT id="filename1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" type="file" name="filename1" runat="server">&nbsp;
</form>