1
我可以添加htmlAttributes像下面及其呈現的HTMLMVC 5.1 - 添加HTML中EditorFor屬性定製編輯器模板
@Html.EditorFor(Function(model) model.LastName, New With {Key .htmlAttributes = New With {Key .ng_model = "model.LastName"}})
但是,當我在Views\Shared\EditorTemplates\Date.vbhtml
添加日期數據類型的自定義編輯模板如下
@Code
Dim value = ""
If Not Model Is Nothing Then
value = String.Format("{0:d}", Model.Value.ToString("dd/MM/yyyy"))
End If
@Html.TextBox("", value, New With {Key .class = "datefield", Key .type = "text"})
End Code
和我使用EditorFor with htmlAttributes然後HtmlAttributes不呈現?
也許一個好主意,發佈什麼是渲染,而不是告訴它不是渲染。 – 2014-10-02 06:49:55