Introduction In this article, I am going to explain what are simple steps if you want to use distributed sessions in order to make your ASP.NET Core application load balanced. Assumption I am assuming that you already have created default project for ASP.NET core MVC app using visual studio. Sessions Session object is used in order to save or store user data for configurable amount of time. It uses dictionary on server side to store data and session id can be used as key to manage data back and forth. There are two types of sessions: 1. In Memory 2. Distributed In case of in memory session, session are stored in memory of a server and if you are using two servers, other server will not have access to it as it is saved in memory of server 1. It is discouraged for load balanced applications. While distributed sessions are stored in centralized place where both servers have access and it is considered to be more useful and reliable mechanism to store data in...
Problem Area: In one of my project, my requirement was to Post File along Complex object to server using AJAX. I could not find ready made solution targeting both things in a single project so I decided to share this solution with you guys to try it out as well. HTML: <input type="file" id="uploadEditorImage" /> <input type="button" id="upload" value="upload" onclick="uploadImage()" /> Javascript: function uploadImage() { var userObj = {}; userObj.userId = "123456"; var serializedObj = JSON.stringify(userObj); var formData = new FormData(); formData.append('file', $('#uploadEditorImage')[0].files[0]); formData.append('vm', serializedObj ); var _urlAction = '@Url.Action("Upload", "Home")'; $.ajax({ ...