我找不出在下面的代碼中缺少的內容。我有一個應該添加一個(假)輔助擴展的方法:無法在VB MVC應用程序中創建HtmlHelper方法
Imports System.Runtime.CompilerServices
Namespace HtmlHelpers
Public Module HelpExtensions
<Extension()> _
Public Function HelpMe(ByVal HtmlHelper As HtmlHelper) As String
Return "<a>HELP</a>"
End Function
End Module
End Namespace
我的看法是這樣的:
<%@ Page Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="HtmlHelpers" %>
<asp:Content ID="indexContent" ContentPlaceHolderID="body" runat="server">
<%=Html.HelpMe()%>
</asp:Content>
但是這給了我以下錯誤:
'HelpMe' is not a member of 'System.Web.Mvc.HtmlHelper'.
我在做什麼錯?
這應該只是在VS環境中的一個錯誤,但它應該運行良好,我們一直這樣做。 – 2015-08-22 12:44:01