-2
你好朋友我從Web服務獲取數據,所以我不能使用Html.DisplayFor(model => model.item)以及如何顯示數組中的數據。這裏是我的代碼:如何在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)
}
這真的屬於視圖嗎? – JTMon
是的,這是視圖 –
可能的重複[如何在MVC3中顯示數組?](http://stackoverflow.com/questions/12214620/how-to-display-an-array-in-mvc3) – David