简体   繁体   English

如何使用 ASP.NET 内核制作 Razor 页面和 C# 代码框架?

[英]How to do you make both a Razor Page and C# code framework with ASP.NET Core?

I have written a rather simple ASP.NET Core web app, which I would like to use as a framework for my future web apps.我编写了一个相当简单的 ASP.NET Core web 应用程序,我想将其用作我未来 web 应用程序的框架。

  • How can I get both functionalities in one single NuGet package - that is the C# and the razor pages templates for future projects? How can I get both functionalities in one single NuGet package - that is the C# and the razor pages templates for future projects?

  • How do I make this kind of template?如何制作这种模板? I can't seem to find any tutorials for the whole package.我似乎找不到整个 package 的任何教程。

  • How do I specify a settings or similar logic for fitting in some variables like the general page name?如何指定设置或类似的逻辑以适应一些变量,如通用页面名称?

How do I specify a settings or similar logic for fitting in some variables like the general page name?如何指定设置或类似的逻辑以适应一些变量,如通用页面名称?

As far as I know, we could modify the asp.net core routes to modify the each routes.据我所知,我们可以修改 asp.net 核心路由来修改每个路由。

For example, the controller is homecontroller and then you use set the attribute route to modify it like "test" like this ``.例如,controller 是 homecontroller 然后你使用设置属性路由来修改它像“测试”这样``。

If you want to make this web application's pages has a specific pre-fix, you could set it as Area.如果您想让这个 web 应用程序的页面具有特定的前缀,您可以将其设置为区域。

[Route("Blog/{action}")]
public class HomeController : Controller

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 ASP.NET Core / Razor 通过单击按钮运行在 Razor 页面上编写的 C#? - How do you run C# written on a Razor page from a button click with ASP.NET Core / Razor? 如何在C#的同一页面上使ASP.NET Control与Silverlight应用程序对话 - How do you make a ASP.NET Control talk to a Silverlight app on the same page in C# 如何在ASP.NET C#/ Razor中传递表单后变量? - How do you pass post form variables in ASP.NET C#/Razor? c# asp.net 如何为只读剃须刀制作下拉列表 - how to make dropdownlistfor readonly razor c# asp.net ASP.Net剃刀页面-如何将JSON从剃刀页面返回到javascript $ .getJson? - ASP.Net Razor Pages - How do you return json from a razor page to javascript $.getJson? 如何将AWS ASP.NET Core日志记录添加到ASP.NET Core 2.0 Razor Pages应用程序? - How do you add AWS ASP.NET Core Logging to an ASP.NET Core 2.0 Razor Pages app? 如何隐藏和显示 asp.net core razor 页面中未在 c# 中的服务器命令中运行的按钮? - how to hide and show button in asp.net core razor page which are not have run at Server command in c#? Razor Page C# ASP.NET Core 获取 Windows 用户名(Windows 身份验证) - Razor Page C# ASP.NET Core get Windows Username (Windows Auth) 如何在javascript代码和asp.net razor mvc代码中利用相同的变量? - How do I utilize the same variable in both javascript code and asp.net razor mvc code? .split with razor details C#asp.net core - .split with razor details C# asp.net core
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM