Tag Archives: javascript

An alternative way to build and bundle Javascript, CSS in ASP.NET Core MVC and Razor Page projects

This article shows how Javascript packages, files, CSS files could be built and bundled in an ASP.NET Core MVC or Razor Page application. The Javascript packages are loaded using npm in which most Javascript projects are deployed. No CDNs are used, only local files so that all external URLs, non self URL links can be […]

Passing Javascript values to ASP.NET Core View components

In this post, I show how an ASP.NET Core MVC view can send a Javascript parameter value to an ASP.NET Core view component. Invoking a view component in the view using ‘@await Component.InvokeAsync’ will not work, as this is rendered before the Javascript value has been created. Code: https://github.com/damienbod/AspNetCoreBootstrap4Validation History 2019-01-24 Added an Anti-Forgery token […]

An ASP.NET Core Razor Pages Bootstrap 4 Application using Webpack, Typescript, and npm

This article shows how an ASP.NET Core Razor Pages application could be setup to use webpack, Typescript and npm to build, and bundle the client js, CSS for development and production. The application uses Bootstrap 4. Code: https://github.com/damienbod/AspNetCorePagesWebpack The example is setup so that the vendor ( 3rd Party packages ) javascript files are used […]

ASP.NET Core, Angular with Webpack and Visual Studio

This article shows how Webpack could be used together with Visual Studio ASP.NET Core and Angular. Both the client and the server side of the application is implemented inside one ASP.NET Core project which makes it easier to deploy. Code: https://github.com/damienbod/AngularWebpackVisualStudio Blogs in this series: ASP.NET Core, Angular with Webpack and Visual Studio Building production […]

Creating an Angular 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/AngularComponentPlotly 2017.02.07: Updated Updated […]

MVC Async File Upload

To use the upload html control inside an ajax request, the following steps need to be taken: Define an ajax function for the upload button Define the form for the upload Add the input file control to the form Handle the file in the MVC controller Return the json result, wrapped in a text item […]