I have a Customer class:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
string Surname { get; set; }
}
How can I use Name and Surname together in one field using Html.EditoFor ?
@Html.EditorFor(model => model.Customer.Name + Surename???? , new { htmlAttributes = new { @class = "form-control" } })
You can try to add
NameWithSurnameproperty to connectedNameandSurnamevalue.NOTE
Your
Surnameproperty might bepublic, otherwise it only can use inCustomerclass.