1 //控制器       
 2  public List<string> ReadFiles(string filePath)
 3         {
 4             List<string> list = new List<string>();
 5            .....
 6            //返回list    
 7             return View(list);
 8         }
 9 
10 //View 遍历
11 @model List<string>
12     @if (Model != null)
13     {
14         foreach (var item in Model)
15         {
16         <ul>
17             <li  class="data-list" data-filename="@item">@item</li>
18         </ul>
19         }
20     }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-09-30
  • 2021-09-05
相关资源
相似解决方案