Does ReadOnly(true) work with Html.EditorForModel?
问题 Consider the following setup: Model: public class Product { [ReadOnly(true)] public int ProductID { get; set; } public string Name { get; set; } } View: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication4.Models.Product>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Home Page </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <%= Html.EditorForModel()