asp.net-core-3.0

Rendering dynamics views in Razor (chtml), How to add a FileProvider to razor in asp.net core 3.0?

三世轮回 提交于 2020-12-26 22:51:22
问题 I am migrating from asp-net core 2.2 to asp-net core 3.0, I was using this block to define my File Class Provider, as you know this is used to create dynamic razor views (dynamic cshtml), my problem is that segment does not work. I have implemented the classic: services.Configure<RazorViewEngineOptions>(opts => opts.FileProviders.Add( new MyCostumizedFileProvider() ) ); Where: MyCostumizedFileProvider : is the Implementation of File Provider. RazorViewEngineOptions : is the handler of the

Difference between `MapControllerRoute`, `MapDefaultControllerRoute`, and `MapControllers`?

半腔热情 提交于 2020-12-05 05:00:31
问题 I'm upgrading .NET Core 2.1 to .NET Core 3.0 and I saw here I have to use UseEndpoints . However, at some pages I've seen it with either MapControllerRoute , MapDefaultControllerRoute , or MapControllers . I checked at the documentation and I saw that MapDefaultControllerRoute is basically the same as MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}") . But I don't understand the difference with MapControllers . What does this last function actually do? The documentation

Difference between `MapControllerRoute`, `MapDefaultControllerRoute`, and `MapControllers`?

谁都会走 提交于 2020-12-05 05:00:27
问题 I'm upgrading .NET Core 2.1 to .NET Core 3.0 and I saw here I have to use UseEndpoints . However, at some pages I've seen it with either MapControllerRoute , MapDefaultControllerRoute , or MapControllers . I checked at the documentation and I saw that MapDefaultControllerRoute is basically the same as MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}") . But I don't understand the difference with MapControllers . What does this last function actually do? The documentation

Call a function on button click in Blazor/Razor - ASP.NET Core 3

大兔子大兔子 提交于 2020-12-04 09:03:46
问题 I just started learning ASP.NET Core and I was following the YouTube tutorial from Microsoft (https://www.youtube.com/watch?v=wA-3FA2kbpA&list=PLdo4fOcmZ0oW8nviYduHq7bmKode-p8Wy&index=11) and when I tried to call the function on button click, it does not work. The code is as follows: Button in HTML <button @onclick="(e => SelectProduct(product.Id))" data-toggle="modal" data-target="#productModal" class="btn btn-primary">More Info</button> @Code Element - Function void SelectProduct(string

Call a function on button click in Blazor/Razor - ASP.NET Core 3

こ雲淡風輕ζ 提交于 2020-12-04 09:02:42
问题 I just started learning ASP.NET Core and I was following the YouTube tutorial from Microsoft (https://www.youtube.com/watch?v=wA-3FA2kbpA&list=PLdo4fOcmZ0oW8nviYduHq7bmKode-p8Wy&index=11) and when I tried to call the function on button click, it does not work. The code is as follows: Button in HTML <button @onclick="(e => SelectProduct(product.Id))" data-toggle="modal" data-target="#productModal" class="btn btn-primary">More Info</button> @Code Element - Function void SelectProduct(string