我有一些vb-net-late-binding-operations-无法转换为表达式树错误 VB.Net Late binding operations cannot be converted to an expression tree
我从
更改了网页代码<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Store.WebUI.Entities.ShippingDetails>" %>
到
<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of Store.WebUI.Entities.ShippingDetails)" %>
修复了关于后期绑定操作的错误 - 无法转换为表达式树 但现在我得到了这个错误。 - 未定义类型“Store.WebUI.Entities.ShippingDetails”。 12 5 - 'Context'不是'ASP.views_cart_checkout_aspx'的成员。 12 5 - 'BeginForm'不是'Html'的成员。 12 15
我的代码是
<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of Store.WebUI.Entities.ShippingDetails)" %>
NetButik:FærdiggørOrdre
<h2>Betaling</h2>
Venligst indtast dine personlige data og vi vil sende deres vare hurtigst muligt!
<% Using (Html.BeginForm())%>
<%: Html.ValidationSummary() %>
<h3>Sendes til</h3>
<div>Navn: <%: Html.EditorFor(Function(x) x.Name)%></div>
<h3>Adresse</h3>
<div>Linje 1: <%: Html.EditorFor(Function(x) x.Line1)%></div>
<div>Linje 2: <%: Html.EditorFor(Function(x) x.Line2)%></div>
<div>Linje 3: <%: Html.EditorFor(Function(x) x.Line3)%></div>
<div>Postnr: <%: Html.EditorFor(Function(x) x.Zip)%></div>
<div>By: <%: Html.EditorFor(Function(x) x.City)%></div>
<div>Landsdel: <%: Html.EditorFor(Function(x) x.Country)%></div>
<h3>Tilvalg</h3>
<label>
<%: Html.EditorFor(Function(x) x.GiftWrap)%>
Disse vare skal i Gaveindpakning.
</label>
<p align="center"><input type="submit" value="Færdiggør ordre" /></p>
<% End Using%>
答案 0 :(得分:0)
检查Store.WebUI.Entities.ShippingDetails类是否存在,您的解决方案中存在对System.Web.Mvc.dll的引用。如果这没有帮助,请在此处发布课程Store.WebUI.Entities.ShippingDetails
。