Hi @M J ,
You need to use item.LastName and item.FirstName. And you need to return your data in the view.
Just like this:
@foreach (var item in Model)
{
string PersonName = item.LastName + ", " + item.FirstName;
<tr>
<td> </td>
<td> </td>
</tr>
}
public ActionResult Index()
{
var list = new List<Applicant>()
{
new Applicant() { ApplicationId = "1",UserId="AA",Gender="AA",Email="AA",PhoneNumber="AA",JobId=1,LocationId=1,
FirstName="AA",LastName="AA",JobTitle="AA",City="AA"},
new Applicant() {ApplicationId = "2",UserId="bb",Gender="bb",Email="bb",PhoneNumber="bb",JobId=1,LocationId=1,
FirstName="bb",LastName="bb",JobTitle="bb",City="bb" },
new Applicant() {ApplicationId = "3",UserId="c",Gender="cc",Email="cc",PhoneNumber="cc",JobId=1,LocationId=1,
FirstName="cc",LastName="cc",JobTitle="cc",City="cc" },
};
return View(list);
}
Best regards,
Yijing Sun
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.