您好朋友,我从 Web 服务获取数据,所以我不能使用 Html.DisplayFor(model=>model.item) 以及如何在数组中显示数据。这是我的代码:
@using icerik.TahakkukServices
@{
ViewBag.Title = "Deneme";
Layout = "~/Views/Shared/_Layout5.cshtml";
}
@{
TahakkukServicesClient client = new TahakkukServicesClient();
client.ClientCredentials.UserName.UserName = "service_test";
client.ClientCredentials.UserName.Password = "";
client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
MakbuzList[] liste = client.GetMakbuzListe(2);
}
@foreach (var item in liste)
{
Html.DisplayFor(item.Adi)
}