在数据推送循环中,我从数据库获取所有数据,包括医生ID。从医生ID如何从图像文件夹位置获取图像。
@foreach (DoctorView doctor in Model.DoctorViews)
{
@:myArray.push("@doctor.DoctorID","<img src="@Url.Content(String.Format("~/Doctor/" + doctor.DoctorID + ".png"))" />", "@doctor.DoctorName", "@doctor.Email", "@doctor.CountryName", "@doctor.City", "@doctor.Mobile");
}
var data = [];
for (var i = 0; i < myArray.length; i++) {
data.push({
"id": myArray[i],
//"name": "Draft",
"doctorName": myArray[i + 1],
"email": myArray[i + 2],
"country": myArray[i + 3],
"city": myArray[i + 4],
"mobile": myArray[i + 5]
})
i = i + 5;
}