VB.Net Late binding operations cannot be converted to an expression tree

I get some VB.Net Late binding operations and get this error:

Late binding operations cannot be converted to an expression tree.

I searched here and can only find solutions for SQL code get data, not for my problem.

On all my lines x.NAME!?

I'm new to this so that someone tells me why I get this error.

<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>   
+3
source share
1 answer

, , Html.EditorFor, . @Page:

<%@ Page 
    Language="VB" 
    MasterPageFile="~/Views/Shared/Site.Master" 
    Inherits="System.Web.Mvc.ViewPage(Of YourApplication.YourModelClass)" %>

, YourApplication.YourModelClass. :

<%: Html.EditorFor(Function(x) x.Name)%>
+1

Source: https://habr.com/ru/post/1776060/


All Articles