Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does this not display the display name?
    primarykey
    data
    text
    <p>I'm trying to display the displaynames for the properties in my html in my ASP.NET MVC 4 application. However even though I've set the displaynames in the viewmodel the raw variable names still gets displayed instead.</p> <p>The viewmodel:</p> <pre><code>public class Manage_ManagePasswordViewModel { [Display(Name="Name")] public string name; [Display(Name = "SubID")] public string subId; [Display(Name = "Conversions")] public int conversions; [Display(Name = "Password")] public string password; public UserProfile owner; public Manage_ManagePasswordViewModel(ProtectedPassword pw) { name = pw.Name; subId = pw.SubId; conversions = pw.GetConversions(); password = pw.Password; owner = pw.Owner; } } </code></pre> <p>The cshtml file:</p> <pre><code>@model Areas.Admin.Models.ViewModels.Manage_ManagePasswordViewModel &lt;div class="editor-label"&gt; @Html.DisplayNameFor(m =&gt; m.name): @Html.DisplayTextFor(m =&gt; m.name) &lt;/div&gt; &lt;div class="editor-label"&gt; @Html.DisplayNameFor(m =&gt; m.password): @Html.DisplayTextFor(m =&gt; m.password) &lt;/div&gt; &lt;div class="editor-label"&gt; @Html.DisplayNameFor(m =&gt; m.subId): @Html.DisplayTextFor(m =&gt; m.subId) &lt;/div&gt; &lt;div class="editor-label"&gt; @Html.DisplayNameFor(m =&gt; m.conversions): @Html.DisplayTextFor(m =&gt; m.conversions) &lt;/div&gt; &lt;div class="editor-label"&gt; @Html.DisplayNameFor(m =&gt; m.owner.UserName): @Html.UserLink(Model.owner.UserName, Model.owner.UserId) &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload