Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6918155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:49:21+00:00 2026-05-27T09:49:21+00:00

MVC 3, VB.NET. I have a form in my app that gets basic information

  • 0

MVC 3, VB.NET. I have a form in my app that gets basic information from the user and then allows them to upload a resume. I am accomplishing this right now by using a redirect to a different form that’s only purpose is to select the file for uploading and then submit it.. Sloppy in my opinion.. I have tried to do it from the same form but the file is being lost on submit.. While I am not certain of it I believe it is because I am not using the correct syntax in the form to handle the file… Below is the View so far and then the controller post function..

@ModelType xxxxxxxx.courseproposal
@Code
ViewData("Title") = "Course Proposal"
End Code
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript">         </script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@Using Html.BeginForm()
@Html.ValidationSummary(True)
@<fieldset>
 <table>
    <tr>
        <th>Presenter 1</th>
    </tr>

    <tr>
        <td>First Name</td>
        <td>Last Name</td>
        <td>Title</td>
        <td>Phone Number</td>
        <td>Email Address</td>

    </tr>
    <tr>
        <th>@Html.EditorFor(Function(model) model.Name_First1) @Html.ValidationMessageFor(Function(model) model.Name_First1)</th>
        <th>@Html.EditorFor(Function(model) model.Name_Last1) @Html.ValidationMessageFor(Function(model) model.Name_Last1)</th>
        <th>@Html.EditorFor(Function(model) model.Title_1) @Html.ValidationMessageFor(Function(model) model.Title_1)</th>
        <th>@Html.EditorFor(Function(model) model.phone_number1) @Html.ValidationMessageFor(Function(model) model.phone_number1)</th>
        <th>@Html.EditorFor(Function(model) model.email_address1) @Html.ValidationMessageFor(Function(model) model.email_address1)</th>
         <th>@Html.Label("file","Filename:")<input type="file" name="file" id="file" />  </th>
    </tr>
</table> 

<div id="sidebar3">

 <p>
 <input type="submit" value="Submit Course Proposal" />
 </p>

 <p>
 @Html.ActionLink("Back to List", "Index")
 </p>
 </div>

</fieldset>
End Using

And the post Function is like this:

   <AcceptVerbs(HttpVerbs.Post)>
    Function CourseProposal(ByVal courseprop As courseproposal) As ActionResult
        courseprop.conf_Number = _AnnualNumber
        db.courseproposals.AddObject(courseprop)
        db.SaveChanges()
        _id = courseprop.idCourseProposal
        Dim _filename As String = String.Empty
        For Each File As String In Request.Files
            Dim hpf As HttpPostedFileBase = TryCast(Request.Files(File), HttpPostedFileBase)
            If hpf.ContentLength = 0 Then
                Continue For
            End If
            Dim savedfileName As String = Path.Combine(AppDomain.CurrentDomain.BaseDirectory) + "\CoursePropResumes\" + Path.GetFileName(hpf.FileName)
            hpf.SaveAs(savedfileName)
            _filename = hpf.FileName
        Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:49:22+00:00Added an answer on May 27, 2026 at 9:49 am

    Your form needs enctype="multipart/form-data".

    Try

    Html.BeginForm(null, null, FormMethod.Post, new { enctype="multipart/form-data"})
    

    EDIT: That of course is for C#. In VB it should read

    Html.BeginForm(Nothing, Nothing, FormMethod.Post, New With { .enctype="multipart/form-data"})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an asp.net mvc app that has a form that uploads a file.
Good day, I have a ASP.net MVC app that needs to upload files to
I have a very basic email submission form in my ASP.NET MVC 3 app.
I have an app that is slowly being upgraded to MVC (MVC.net?) from ASP.net.
I have a form that collects a data using ASP.NET MVC. It looks like
I have an ASP.NET MVC form that when submitted can return either an ActionResult
I have an ASP.NET MVC project with a form. In the Action method that
I have a simple form on an ASP.NET MVC site that I'm building. This
I have an ASP.NET MVC3 app that features a form with a nested-table input
I'm building an advanced search form for my ASP.NET MVC app. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.