?
Solved

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

Posted on 2010-11-20
3
Medium Priority
?
918 Views
Last Modified: 2013-11-07
Hi I get this error
"Late binding operations cannot be converted to an expression tree."

At all my x.NAME) lines !?

Im new to this so can anyone say me why i get this error..
Hvorfor gør den det !?

<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>

Open in new window


My View/CheckOut.aspx
<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Store.WebUI.Entities.ShippingDetails>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	NetButik : Færdiggør Ordre
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <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%>

</asp:Content>

Open in new window


My Entities/ShippingDetails.vb site
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.ComponentModel.DataAnnotations

Namespace Store.WebUI.Entities
    Public Class ShippingDetails
        <Required(ErrorMessage:="Venligst skriv et Navn.")> _
        Public Property Name() As String
            Get
                Return m_Name
            End Get
            Set(ByVal value As String)
                m_Name = value
            End Set
        End Property
        Private m_Name As String
        <Required(ErrorMessage:="Venligst udfyld 1. adresse linje.")> _
        Public Property Line1() As String
            Get
                Return m_Line1
            End Get
            Set(ByVal value As String)
                m_Line1 = value
            End Set
        End Property
        Private m_Line1 As String
        Public Property Line2() As String
            Get
                Return m_Line2
            End Get
            Set(ByVal value As String)
                m_Line2 = value
            End Set
        End Property
        Private m_Line2 As String
        Public Property Line3() As String
            Get
                Return m_Line3
            End Get
            Set(ByVal value As String)
                m_Line3 = value
            End Set
        End Property
        Private m_Line3 As String
        <Required(ErrorMessage:="Venligst indtast Postnr.")> _
        Public Property Zip() As String
            Get
                Return m_Zip
            End Get
            Set(ByVal value As String)
                m_Zip = value
            End Set
        End Property
        Private m_Zip As String
        <Required(ErrorMessage:="Venligst indtast Bynavn.")> _
        Public Property City() As String
            Get
                Return m_City
            End Get
            Set(ByVal value As String)
                m_City = value
            End Set
        End Property
        Private m_City As String
        <Required(ErrorMessage:="Venligst indtast Landsdel.")> _
        Public Property Country() As String
            Get
                Return m_Country
            End Get
            Set(ByVal value As String)
                m_Country = value
            End Set
        End Property
        Private m_Country As String
        Public Property GiftWrap() As Boolean
            Get
                Return m_GiftWrap
            End Get
            Set(ByVal value As Boolean)
                m_GiftWrap = value
            End Set
        End Property
        Private m_GiftWrap As Boolean
    End Class
End Namespace

Open in new window


I Hope u can help me...
0
Comment
Question by:tjgrindsted
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Expert Comment

by:QPR
ID: 34184417
Are you inheriting the shippingdetails class in your <%@ Page  tag?
0
 

Accepted Solution

by:
tjgrindsted earned 0 total points
ID: 34191072
yes
<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Store.WebUI.Entities.ShippingDetails>" %>

But found the error
<%@ Page Language="vb" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage(Of Store.WebUI.Entities.ShippingDetails)" %>
0
 

Author Closing Comment

by:tjgrindsted
ID: 34221274
no
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question