0
在我的Employee表中,字段类似于EmployeeID,FirstName,MiddleName,LastName,...就像那样。绑定Html.DropDownList
我想绑定我的Html.DropDownList像EmployeeID作为dataValueField和FirstName + MiddleName + LAstName作为dataTextField。我该如何绑定?
在我的Employee表中,字段类似于EmployeeID,FirstName,MiddleName,LastName,...就像那样。绑定Html.DropDownList
我想绑定我的Html.DropDownList像EmployeeID作为dataValueField和FirstName + MiddleName + LAstName作为dataTextField。我该如何绑定?
Create a partial class and set a property like this
public string Name
{
get
{
return string.Format("{0} {1} {2}", FirstName, MiddleName, LastName);
}
}
Give 'Name' as the dataTextField
谢谢,这解决了我的问题。非常感谢。 – Mukesh 2011-04-20 04:36:31