I know these question(s) has been asked
- Cannot convert lambda expression to type 'string' because it is not a delegate type
- Entity Framework - Cannot convert lambda expression to type 'string' because it is not a delegate type
But none of them has helped me to find the problem that i am facing
i have tried to use this solution
<div class="form-group">
@Html.LabelFor(model => model.Postcode_area_name, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBox(model => model.Postcode_area_name, new { disabled = "disabled", @readonly = "readonly" })
</div>
</div>
to make one edit field read only, but i do get an error of Cannot convert lambda expression to type 'Delegate' because it is not a delegate type i do use entity frame work and these using
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using CRM2.Models;
the suggestion on other questions are that using
using System.Data.Entity;
using System.Linq;
should fix the problem but it does not work for me I am using MVC 5
i have fixed the issue by using this solution
@Html.DisplayFor(model => model.Postcode_area_name)
@Html.HiddenFor(model => model.Postcode_area_name)
but because i am new on MVC and entity frame work i want learn why the other way throw an error
Sorry for English "mistake" Thank you