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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:43:47+00:00 2026-05-30T05:43:47+00:00

Using MVC3 for the first time, so sorry for the noob-like question. I’m trying

  • 0

Using MVC3 for the first time, so sorry for the noob-like question.

I’m trying to annotate my data model for the UI layer. In my model, I have the following

[DisplayName("First Name")]
public string firstName { get; set; }

When I create a view based on the Details/Delete scaffold, it generates the following:

<div class="display-label">firstName</div>
<div class="display-field">
    @Html.DisplayFor(model => model.firstName)
</div>

This does not, obviously, use my annotated model. When I create a view based on the Create/Edit scaffold, it generates this HTML:

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

Because it’s using the @Html.LabelFor, it ultimately uses my annotated model as I anticipated.

Obviously I can see the common thread – the first two are editable, the second two are readonly. I cannot imagine why they would save me the trouble on two of them, and not on the others, but I’m sure there has to be a reason, right?

So if there IS a reason, is my only solution to manually go through each of the views & change the content from firstName to First Name?

  • 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-30T05:43:49+00:00Added an answer on May 30, 2026 at 5:43 am

    I don’t know why they did that either, but you can create your own display template for objects as explained here that uses your annotation.

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

Sidebar

Related Questions

I am first time trying on ASP.NET MVC3 , defined the model (C#) and
Using Entity Framework 4.1 code first and POCO entities in MVC3; I would like
I have an MVC3 project I created using the Code First paradigm and it
I have developed a project using MVC3 and Code first Entity Framework 4.0 as
It's my first time using nHibernate (also never used hibernate), and i'm trying to
i'm building an MVC3 site and using Knockout / JSON for the first time,
I just created a new project in MVC3 using EF4 code first deployed on
I am trying to implement user registration on my mvc3 site using fb. My
I have a small MVC 3 app using Entity Framework Code First and use
I'm writing an ASP.net MVC3 application using Entity Framework Code First and SqlCe4. I

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.