可能需要检查以下几个方面:
@model List
// ...
@for (int i = 0; i < Model.Count; i++)
{
@Model[i].Name
@Model[i].Description
// ...
}
public ActionResult MyAction(List myModelList)
{
if (myModelList != null && myModelList.Count > 0)
{
// Code to handle incoming data
}
else
{
// Handle empty or null List Type Model
}
// ...
}
public class MyModel
{
public string Name { get; set; }
public string Description { get; set; }
// ...
}
通过检查这些方面,您就可以确定为什么List Type模型为空,并且采取必要的步骤来解决问题。