title: upload form (.vbhtml) and VB controller
body: <p>I am new to vb programming and have been trying to implement an upload form to upload files to my webserver.  I am using .vbhtml and VB .  I've created the form but when I click on the submit button "Button1_Click" , nothing happens.  here's my code</p>
  
  <p>---- Index.vbhtml code -----</p>
  
  <pre><code>@Code
      ViewData("Title") = "Home Page"
   End Code  
  
  
      &lt;form id="form1" runat="server" action=""&gt;
          &lt;div&gt;
              &lt;input type="file" ID="FileUpload1" runat="server" /&gt;&lt;br /&gt;
              &lt;br /&gt;
              &lt;input type="button" ID="submit_button" runat="server" OnClick="Button1_Click" 
               value="Upload File" /&gt;&amp;nbsp;&lt;br /&gt;
              &lt;br /&gt;
               &lt;span id="Span1" runat="Server" /&gt;
               &lt;/div&gt;
        &lt;/form&gt; 
  </code></pre>
  
  <p>-------- code used in the HomeController.vb -------------------</p>
  
  <pre><code>Public Class HomeController
  
  Inherits System.Web.Mvc.Controller
  
  
  Dim Span1 As Object
  Dim FileUpload1 As Object
  
  
  
  
  'Upload file
  
  Public Sub Button1_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs)
  
      If FileUpload1.HasFile Then
          Try
              FileUpload1.SaveAs("C:\inetpub\wwwroot\Uploads\" &amp; _
                 FileUpload1.FileName)
              Span1.Text = "You have specified a file."
              Span1.Text = "File name: " &amp; _
                FileUpload1.PostedFile.FileName &amp; "&lt;br&gt;" &amp; _
                 "File Size: " &amp; _
                FileUpload1.PostedFile.ContentLength &amp; " kb&lt;br&gt;" &amp; _
                 "Content type: " &amp; _
                 FileUpload1.PostedFile.ContentType
          Catch ex As Exception
              Span1.Text = "ERROR: " &amp; ex.Message.ToString()
          End Try
      Else
          Span1.Text = "You have not specified a file."
      End If
  End Sub
  
  End Class
  </code></pre>
  
  <hr>
  
  <p>Please let me know if I am missing something . </p>