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

  • SEARCH
  • Home
  • 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 9292613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T20:55:20+00:00 2026-06-18T20:55:20+00:00

here is my view. I am attempting to have a file upload control. @section

  • 0

here is my view. I am attempting to have a file upload control.

@section termimalContent {
  @using (Html.BeginForm("Add", "Terminals_Policies", "multipart/form-data"))
  {
    @Html.ValidationSummary(true)
    <fieldset>
      <legend>
        <h2>
            Create new policy</h2>
      </legend>
      <p>
        <strong>Assigning devices to Node:</strong> @Model.GroupName</p>
      <div class="editor-label">
        @Html.LabelFor(model => model.PolicyName)
      </div>
      <div class="editor-field">
        @Html.EditorFor(model => model.PolicyName)
        @Html.ValidationMessageFor(model => model.PolicyName)
      </div>
      <div class="editor-label">
        @Html.LabelFor(model => model.PolicyType)
      </div>
      <div class="editor-field">
        @Html.DropDownListFor(model => model.SelectedItems, new SelectList(Model.PolicyType, "Value", "Text"))
        @Html.ValidationMessageFor(model => model.SelectedItems)
      </div>
      <div class="editor-label">
        <label for="file1">
          Filename:</label>
      </div>
      <div class="editor-field">
        <input type="file" name="files" id="file1" />
      </div>
      <div class="editor-label">
        <label for="file2">
          Filename:</label>
      </div>
      <div class="editor-field">
        <input type="file" name="files" id="file2" />
      </div>
      @Html.HiddenFor(model => model.GroupId)
      @Html.HiddenFor(model => model.GroupName)
      <p>
        <input type="submit" value="Create" />
      </p>
    </fieldset>
  }
}

but the html is being rendered as:

<form action="/Terminals_Policies/Add/1?Length=19" id="form0" method="post">

Anyone know what i have done wrong

  • 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-06-18T20:55:21+00:00Added an answer on June 18, 2026 at 8:55 pm

    Try:

    @using (Html.BeginForm("Add", "Terminals_Policies", FormMethod.Post,new{enctype="multipart/form-data"}))
    

    As it should be in the format

    Html.BeginForm(action, controller, FormMethod.Post, new { 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 a layout setup which can be view here: http://jsfiddle.net/Pn3ts/ It all works
I using coda slider in my page. View it here: http://www.ndoherty.com/demos/coda-slider/1.1.1/ Each tab causes
Here's a basic view of what my html looks like: <form> <div id=part1> //
Here is my code, I have been attempting to find a way to do
Greetings, I'm using WPF with a Model-View-ViewModel pattern, and I have a view model
I have a UITableView showing data from a plist file. For this table view,
I'm attempting to create a grid style view (similar to NSCollectionView ), except using
I am using the php framework codeigniter. I am attempting to create a here
I am attempting to write my first userscript using Greasemonkey, in Firefox. I have
Attempting to upload a file to a database and was wondering if someone could

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.