我试图以显示下拉列表中父子元素选择list.as以下图像如何在下拉菜单中添加子项目的空间?
我的代码中的foreach
@helper GetOption(List<Project_Cost_Management_System.Models.ChartOfAccount> model1, Guid? parentid)
{
foreach (var item3 in model1.Where(s => s.ParentAccountId.Equals(parentid)))
{
var zs3 = model1.Where(s => s.ParentAccountId == item3.Id);
int count3 = zs3.Count();
if (count3 >= 0)
{
if(@item3.ParentAccountId == null)
{
<option value="@item3.Id">@item3.Name</option>
}
else
{
var cout = model1.Count();
<option value="@item3.Id"> @item3.Name @model1.Where(s => s.dataid == @item3.dataparentid).Select(d => d.Name).First(). </option>
}
}
if (count3 > 0)
{
@GetOption(model1, item3.Id)
}
}
}
,但它表现为
如何我可以显示为第一张照片吗?
您可以发布当前输出演示吗? –
秒图是 –
我的意思是现场演示。我们如何分析代码? :)你有一个动态代码。 –