我在自定义助手中使用了TextBoxFor控件。并且它不会生成id属性。这是一个已知的问题吗?或者我在自定义助手中做错了什么?我在下面给出了我的代码,
App_Code/customhelper.vbhtml
@Import System.Web.Mvc
@Import System.Web.Mvc.Html
@ModelType EditorVB.DateSettings
@Helper MyHelper(ByVal page As WebViewPage, ByVal model As EditorVB.DateSettings)
@page.Html.TextBoxFor(Function(x) model.EndDate)
End Helper
Views/index.vbhtml
@ModelType EditorVB.DateSettings
@CustomHelper.MyHelper(PageContext.Page, Model)
DateSettings.vb
Public Class DateSettings
Public Property EndDate() As DateTime
Get
Return m_EndDate
End Get
Set(value As DateTime)
m_EndDate = value
End Set
End Property
Private m_EndDate As DateTime