For those who are new to Asp.net, session state is a way to store and retrieve user specific values. This state is linked to a user and it’s lifetime equals the duration of the user ‘s session. The session state can be programmatically accessed during the different requests of the user. When you enable the […]

Read More →

Configure for localization Like everything in the Asp.net Core, you have to modify your startup class. Because by default only the minimum is configured. So you’ll need to op-in localization in you application.  This is done in the ConfigureServices method in the Startup class. public void ConfigureServices(IServiceCollection services) { services.AddLocalization(options => options.ResourcesPath = “Resources”); services.AddMvc().AddViewLocalization(); […]

Read More →

In my previous post Cache tag helper in MVC 6 i explained how you can cache certain parts from you view. In this post I’ll show you how you can cache the entire output of a controller action and how you can define cache profiles that can be used in your entire application. Reponse cache […]

Read More →

In MVC 6 you can use Tag Helpers in your views. They are similar come the HTML helpers when know but tag helpers lean more to html then C# code. I already wrote some posts (Creating a custom tag helper, Tag helper and dependency Injection) about tag helpers but in this one I’ll take a look […]

Read More →

Cross-Site Request Forgery (CSRF) Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated. CSRF attacks specifically target state-changing requests, not theft of data, since the attacker has no way to see the response to the forged request. With a […]

Read More →

I was wondering if you could use Dependency Injection to initialize an Asp.net mvc taghelper. I’ll modify the example used in my previous post Creating a custom taghelper. Creating a service to inject public interface IPersonService { string GetName(); } public class PersonService : IPersonService { public String GetName() { return “PersonService.GetName()”; } } Register […]

Read More →

Taghelpers are new to Asp.net mvc 6. In this post i’ll show you how to create a custom taghelper. What is a taghelper? Basically taghelpers do the same thing as the htmlhelpers we all know. If you use a htmlhelper in your view, you’ll see that it is actually C# code. If you would use […]

Read More →

Version 6 of C# contains a bunch of new features that allows to speed up the productivity of the developer. Feature 1 : static usings The classes are structured by their usings. If you need a specific class, you’ll need to add a using containing the namespace of that class. If you do this, you’ll […]

Read More →