https://codingblast.com/asp-net-core-razor-pages-handlers/
https://www.cnblogs.com/tdfblog/p/razor-pages-handlers-in-asp-net-core.html
2020年6月7日 星期日
2020年6月1日 星期一
TagMode.StartTagAndEndTag
https://docs.microsoft.com/zh-tw/aspnet/core/mvc/views/tag-helpers/authoring?view=aspnetcore-3.1
ref:
https://www.cnblogs.com/dotNETCoreSG/p/aspnetcore-4_3_6_2-tag-helpers-authoring.html
You can use the following markup with a closing tag and remove the line with
TagMode.StartTagAndEndTag in the tag helper:<website-information info="webContext" >
</website-information>
https://whosnailaspnetcoredocs.readthedocs.io/ko/latest/mvc/views/tag-helpers/authoring.html[HtmlTargetElement("email", TagStructure = TagStructure.WithoutEndTag)] public class EmailVoidTagHelper : TagHelper { private const string EmailDomain = "contoso.com"; // Code removed for brevity
https://www.cnblogs.com/dotNETCoreSG/p/aspnetcore-4_3_6_2-tag-helpers-authoring.html
2020年5月23日 星期六
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor' while attempting to activate
寫.NET Core遇到Unable to resolve service for type通常是忘記註冊物件給DI容器
Startup.cs的ConfigureServices(IServiceCollection services)加入以下這一行
//TagsHelper使用
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
錯誤訊息:
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor' while attempting to activate
Startup.cs的ConfigureServices(IServiceCollection services)加入以下這一行
//TagsHelper使用
services.AddSingleton<IActionContextAccessor, ActionContextAccessor>();
錯誤訊息:
InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor' while attempting to activate
訂閱:
文章 (Atom)