【发布时间】:2011-06-14 22:15:00
【问题描述】:
我的扩展没有导入到我的 vbhtml 视图中。我似乎在某处遗漏了一些东西..有人可以帮忙吗?
module.vb:
Imports System.Runtime.CompilerServices
Namespace Areas.Admin.Models.Extensions
<Extension()> _
Public Module InputExtensions
Public Function SelectHumanGroup(ByVal helper As HtmlHelper, ByVal name As String, Optional ByVal selectedValue As String = "", Optional ByVal htmlAttributes As Object = Nothing) As MvcHtmlString
Return helper.DropDownList(name, repo.GetGroups(), htmlAttributes)
End Function
End Module
End Namespace
view.vbhtml:
@Imports MySite.Areas.Admin.Models.Extensions
@ModelType MySite.Models.MyViewModel
@Code
ViewData("Title") = "Index"
End Code
<h2>Index</h2>
@Html.SelectHumanGroup("test")
【问题讨论】:
标签: asp.net-mvc-3 razor