Tag Archives: MVC

ASP.NET Core Action Arguments Validation using an ActionFilter

This article shows how to use an ActionFilter to validate the model from a HTTP POST request in an ASP.NET Core MVC application. Code: https://github.com/damienbod/Angular2AutoSaveCommands 2016.12.23: Updated to Visual Studio 2017 and ASP.NET Core 1.1 Other articles in this series: Implementing UNDO, REDO in ASP.NET Core Angular 2 Auto Save, Undo and Redo ASP.NET Core […]

Injecting Configurations in Razor Views in ASP.NET Core

This article shows how application configurations can be injected and used directly in razor views in an ASP.NET Core MVC application. This is useful when an SPA requires application URLs which are different with each deployment and need to be deployed as configurations in a json or xml file. Code: https://github.com/damienbod/AspNetCoreInjectConfigurationRazor 2017.01.07: Updated to VS2017 […]

Import and Export CSV in ASP.NET Core

This article shows how to import and export csv data in an ASP.NET Core application. The InputFormatter and the OutputFormatter classes are used to convert the csv data to the C# model classes. Code: https://github.com/damienbod/AspNetCoreCsvImportExport 2016.11.25: Updated ASP.NET Core 1.1 2016.06.29: Updated to ASP.NET Core RTM The LocalizationRecord class is used as the model class […]

Adding SQL localization data using an Angular 2 form and ASP.NET Core

This article shows how SQL localized data can be added to a database using Angular 2 forms which can then be displayed without restarting the application. The ASP.NET Core localization is implemented using Localization.SqlLocalizer. This NuGet package is used to save and retrieve the dynamic localized data. This makes it possible to add localized data […]

Angular 2 Localization with an ASP.NET Core MVC Service

This article shows how localization can be implemented in Angular 2 for static UI translations and also for localized data requested from a MVC service. The MVC service is implemented using ASP.NET Core. This post is the first of a 3 part series. The following posts will implement the service to use a database and […]

Creating an Angular 2 Component for Plotly

This article shows how the Plotly javascript library can be used inside an Angular 2 Component. The Angular 2 component can then be used anywhere inside an application using only the Angular Component selector. The data used for the chart is provided in an ASP.NET Core MVC application using Elasticsearch. Code: https://github.com/damienbod/Angular2ComponentPlotly 2016.08.18: Updated to […]

Angular2 secure file download without using an access token in URL or cookies

This article shows how an Angular 2 SPA client can download files using an access token without passing it to the resource server in the URL. The access token is only used in the HTTP Header. If the access token is sent in the URL, this will be saved in server logs, routing logs, browser […]