asp.net core razor加载模板文件路径

浪淘沙9个月前后端149
  var templateContent = "${include(\"" + App.HostEnvironment.ContentRootPath + "\\Pages\\Shared\\_top.cshtml\")}";
  var template = Engine.CreateTemplate(templateContent); 
  var result = template.Render();
  return Content(result);


相关文章

ubuntu 删除asp.net core 8.0

1. 查找已安装的 ASP.NET Core 8.0 版本dotnet --list-runtimes dotnet --list-sdks2. 删除 ASP.NET Core...

asp.net core razor 写入读取cookie集合

@{     Layout = null; } <form method="post">...

C#JNTemplate模板引擎,标签指定${set(pagetotal=20)},后端如何获取pagetotal的值

using JinianNet.JNTemplate; class Program {     static void&...

asp.net core post

<form class="layui-form layui-form-pane" action="" method...

JNTemplate 模板标签传递url参数

一、模板 private readonly SqlSugar.ISqlSugarClient _db;  public Index1M...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。