2013-05-06 60 views
0

運行一把umbraco 6.05,我有數據註釋的定製模型類,如:一把umbraco MVC形式模型驗證標記不表示

[必需,StringLength(100),數據類型(DataType.EmailAddress),數據類型(DataType.MultilineText )]

和我的模型傳遞給視圖,像這樣:

@inherits Umbraco.Web.Mvc.UmbracoViewPage<test.local.Models.ContactForm> 

<script src="~/Scripts/jquery-1.7.1.min.js"></script> 
<script src="~/Scripts/jquery.validate.min.js"></script> 
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script> 

@using (Html.BeginForm()) { 
    @Html.ValidationSummary(true) 

    <fieldset> 
     <legend>ContactForm</legend> 

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

     ... 

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

但是,當它呈現的「數據-VAL」屬性丟失,但有趣的數據類型EmailAddress的/複線做工精細通過插入'type =「email」'並創建一個'textarea'appropr iately。

任何想法我可能做錯了什麼?

乾杯

+0

你能爲你的模型定義添加代碼? – cpoDesign 2013-06-21 08:35:47

回答