Error: it is not possible to convert a lambda expression to enter "string" because it is not a delegate type
I get this error when I try to add the cshtml page in mvc4. at line
Customer Name: @ Html.TextBox (m => Model.CustomerName)
Can someone explain what its meaning is and why it comes here?Code
@model DataEntryMvcApplication.Models.Customer
@using (Html.BeginForm())
{
<p>Customer Name: @Html.TextBox(m => Model.CustomerName)</p>
<p>ID:@Html.TextBox(m=>Model.CustomerId)</p>
<input type="submit" name="Custtomer" />
}
and this is the model class;
namespace DataEntryMvcApplication.Models
{
public class Customer
{
public string CustomerId { get; set; }
public string CustomerName { get; set; }
}
}
source
share