asp.Net Core ViewComponent doesn’t show CSS

I’m trying to get to grips with ViewComponents but having trouble trying to get the ViewComponent to reload on a button click. Whats the correct way to handle this? Initially on the page loading it looks OK like this In my controller I have public IActionResult ReloadViewComponent(int characterRegionId, int materialTypeId) { return ViewComponent(“MarketOrderComponent”, new {…

Serializing dates for Safari on MacOs in asp.net MVC & WebApi app

I inherited a web app app that uses this setting for serializing date/time values. var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; json.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Unspecified; All the users of the app are in the PST timezone. Firefox & Chrome parse “yyyy-mm-ddThh:mi:ss” values as local dates (local to the browser). However, Safari parses “2019-08-16T00:00:00” (i.e. new Date(“2019-08-16T00:00:00”) as “Thu Aug…

How to use OnActionExecutionAsync in ASP.NET Core

How is this method overridden? Assume an inheritence graph like so. FeatureController : BaseController : Controller { } I’d like to run code before execution and after execution, and do so in both FeatureController and BaseController. It’s confusing because there’s two things that can be awaited; await base.OnActionExecutionAsync(context, next); And await next(); It’s just not…

In ASP.NET Core 3.0 MVC Project, How exactly do I log to app insights using ilogger?

I’m trying to determine how exactly to log to app insights user _logger.LogInformation Im not finding the documentation https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core very helpful. For example, lets imagine you create an asp.net core 3.0 MVC project using visual studio (template) By default, the controller has injected _logger. What exact step-by-steps are required to get the logger to send…