Disable User in ASPNET identity 2.0

When you create a site with the Identity bits installed, your site will have a file called “IdentityModels.cs”. In this file is a class called ApplicationUser which inherits from IdentityUser. // You can add profile data for the user by adding more properties to your ApplicationUser class, please visit https://devblogs.microsoft.com/aspnet/customizing-profile-information-in-asp-net-identity-in-vs-2013-templates/ to learn more. public class … Read more

Asp.net Validation of viewstate MAC failed

Microsoft says to never use a key generator web site. Like everyone else here, I added this to my web.config. <System.Web> <machineKey decryptionKey=”ABC123…SUPERLONGKEY…5432JFEI242″ validationKey=”XYZ234…SUPERLONGVALIDATIONKEY…FDA” validation=”SHA1″ /> </system.web> However, I used IIS as my machineKey generator like so: Open IIS and select a website to get this screen: Double click the Machine Key icon to get … Read more

Search Engine – Lucene or Solr

Lucene: Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search Solr: Solr is an open source enterprise search server based on the Lucene Java search library, with XML/HTTP and JSON APIs, hit highlighting, faceted search, caching, replication, … Read more

Streaming large file uploads to ASP.NET MVC

It turns out that my initial code was basically correct; the only change required was to change request.ContentLength = clientRequest.InputStream.Length; to request.ContentLength = clientRequest.ContentLength; The former streams in the entire request to determine the content length; the latter merely checks the Content-Length header, which only requires that the headers have been sent in full. This … Read more

Difference between HttpRuntime.Cache and HttpContext.Current.Cache?

I find following detail from http://theengineroom.provoke.co.nz/archive/2007/04/27/caching-using-httpruntime-cache.aspx For caching I looked into using HttpContext.Current.Cache but after reading other blogs I found that caching using HttpContext uses HttpRuntime.Cache to do the actual caching. The advantage of using HttpRuntime directly is that it is always available, for example, in Console applications and in Unit tests. Using HttpRuntime.Cache is … Read more

tech