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 8612991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:45:46+00:00 2026-06-12T04:45:46+00:00

I tried to generate a view for file upload but the upload part was

  • 0

I tried to generate a view for file upload but the upload part was missing and the rest class members have view generated for them

View Model

namespace myapps.Models.ViewModels
{
    public class UserPhotoUploadViewModel
    {

        public HttpPostedFile PhotoFile
        {
            get;
            set;
        }

        public Guid UserID
        {
            get;
            set;
        }
    }
}

Generated View

@model myapps.Models.ViewModels.UserPhotoUploadViewModel

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>UserPhotoUploadModel</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.UserID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserID)
            @Html.ValidationMessageFor(model => model.UserID)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

Am I expected to fill in the rest? Is this a usual behaviour and are there limit to what asp.net MVC3 could generate?

  • 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-12T04:45:47+00:00Added an answer on June 12, 2026 at 4:45 am

    Yes, this is standard behavior. You can examine the default T4 Template and see how it works, it should be located in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTemplates\AddView\CSHTML\Create.tt

    The most important method is GetEligibleProperties – as you can see it gets only primitive types (that are public and so on).

    Here’s an example of dealing with HttpPostedFile in ASP.NET MVC projects Can EditorFor() be used to create <input type="file">?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after read this article i tried generate EF model by System.Diagnostics.Process: Process myProcess =
I have tried to generate Hello World with openxml sdk. To my surprise when
I use maven 3.0.3 and have tried to generate pom for third-party jar like
I've tried some tools for generate automatically class diagrams from the java source code
I need to generate a lot of random numbers. I've tried using random.random but
I have to generate 250 plots with the same view. My example data set:
I have a front-end component view that I need to include a .js file
I have a CListView that uses ajaxLink() in the _view file. View (index.php) <?php
The JPEG Images that ImageIO generated view correctly on windows file explorer, as well
I tried using axis2 1.6 (and nightly 1.7) to generate Java code from the

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.