Blog

Blog posts on .NET, Azure, and more.

Build your own middleware - HTML Minification middleware

July 13, 2015 by Anuraj

.Net ASP.Net ASP.Net MVC Visual Studio

Minification refers to the process of removing unnecessary or redundant data without affecting how the resource is processed by the browser - e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on. If you are using wordpress, you will get some plugins which will help you to minify HTML and other static files like CSS, Javascript. ASP.NET MVC comes with bundling and minification feature which will help you to minify CSS and Javascript. This post is about a HTML Minification middleware, which will help developers to remove the whitespace in the generated HTML content.

Build your first ASP.NET 5 middleware

July 08, 2015 by Anuraj

.Net .Net 3.0 / 3.5 ASP.Net ASP.Net MVC

This post is about developing your own ASP.NET 5 middleware. What is Middleware - The definition of “Middleware” varies depends on its context, but in ASP.NET 5, the definition provided by the OWIN specification is probably closest - Pass through components that form a pipeline between a server and application to inspect, route, or modify request and response messages for a specific purpose. Middleware components are similar to ASP.NET HttpModules and/or HttpHandlers. You can access the ASP.NET request pipeline via Startup.cs class, Configure() method. Configure method helps developers to plugin middleware components. Here is the Startup.cs from HelloMVC sample project

How to create and access session variables in ASP.NET 5

July 07, 2015 by Anuraj

.Net ASP.Net ASP.Net MVC

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. Sessions values can be stored for the duration of the visitor’s session on your site. Most cases, they are stored in server memory. You can configure session to store either in State server or in SQL Server. In ASP.NET MVC, you can create and access session variables using HttpContext.Current.Session. In ASP.NET 5, ASP.NET team implemented a middleware to support session management.

File upload in ASP.NET Core

July 06, 2015 by Anuraj

.Net ASP.Net ASP.Net MVC ASP.NET Core

In ASP.NET 5 MVC 6 Microsoft changed the File upload feature. Now MVC 6 support model binding of multipart form data, which means, you can include file as the property of your model.

Continuous Integration with ASP.NET 5, GitHub and Travis CI - Part 2

July 05, 2015 by Anuraj

.Net ASP.Net ASP.Net MVC Version Control

Few days back I did a post on Continuous Integration with ASP.NET 5, GitHub and Travis CI. In that post I was using K runtime and K commands. From ASP.NET 5 Beta 4, Microsoft changed the runtime to DNX, the K runtime became obsolete. This post is about continuous integration using DNX runtime. Only minor changes are required. Here is the .travis.yml file.

Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub