朋友你好我想列出我的陣列和我的DATAS來自Web服務,所以我不能用Html.DisplayFor(型號=>模式。)這裏是我的視圖代碼如何在MVC3中顯示數組?
@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)
}
但我不使用「模型」標記我的數據來自Web服務而不是模型 –