ASP.NET MVC DropDown list with multiple properties in multiple rows

Viewed 23

Complementary to this question Asp.net MVC multiple fields in dropdown list.

How can I write multiple properties in a DropDownList? I tried to use "\n" and Environment.NewLine, but it didn't work.

Example with "\n":

var ground = db.database
    .Select(s => new
    {
        Text = s.Adress + "\n " + s.Home + "\n" + s.Number,
        Value = s.ID
    })
    .ToList();
0 Answers
Related