BeginForm is not a member of 'Html' and Encode is not a member of HTML
I'm working on this big project in MVC ASP.NET w\ VB.NET One of my views is getting me headaches since a few and i'm not sure what's up. I've used the Begin.Form and Html.Encode methods alot in my other views and i never had any problems. Now this new Create.aspx view for one of my object called Automation is giving me multiple build errors such as those cited in the title plus
Error 184 'Context' is not 开发者_如何学Ca member of 'ASP.views_automatisation_create_aspx'.
BeginForm is not a member of 'Html'
Encode is not a member of HTML
My header is as follow (just like all of my other working views headers) :
<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of XXXXX_XXXXX.Automatisation)" %>
Can anyone help me out ?
Thanks everyone for reading.
Check whether you have renamed your Model.
If you are using strongly typed-view then these kind of error is there.
Note:- Even though, you have added correct namespaces in your program, and most of the errors not specifically gives you the exact problem.
Does it work if you manually import the namespace (below @page):
<%@ Import Namespace="System.Web.Mvc.Html" %>
My guess is that you have deleted a <%
somewhere by mistake in your .aspx file.
Did you remember to schlep the little web.config that was in your views folder around? And did you remove any of the <add />
elements in the <pages><namespaces>
bits of your web.config?
精彩评论