大家好如何通过两个或多个IEnumerables列表来查看?这是我的动作控制器:
ServicesClient client = new ServicesClient();
client.ClientCredentials.UserName.UserName = "service_test";
client.ClientCredentials.UserName.Password = "..";
client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
ListCity[] city = client.GetCity();
ListStreet[] street = client.GetStreet(2);
return View(city);
我的观点:
model IEnumerable<ListCity>
@using icerik.EmlakServices
@{
Layout = "~/Views/Shared/Test.cshtml";
}
<select>
@foreach(var item in Model)
{
<option>@Html.DisplayFor(x => item.CityName)</option>
}
</select>