以图片为例

后台Controller.cs

public FileResult ImageUrl(string file)
{
return File("物理路径"+file, "image/png");

}

 

前台.cshtml

 

<img src='@Url.Action("ImageUrl", "控制器名称", new {h.file , area="区域名"})' alt="">

或者

<img src='@Url.Action("ImageUrl", "控制器名称", new {area="区域名"})?file=@h.file' alt="">

相关文章:

  • 2021-05-08
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2022-12-23
  • 2021-12-09
  • 2021-07-18
  • 2022-12-23
相关资源
相似解决方案