January 30, 2015

I have a website that I configured to use https using IIS and have setup the links to point to the https version of the site. However, IIS does not automatically redirect the http version of the site to https and instead display error messages on the screen. This is bad as other sites had linked to the http version of prior to setting up https.

January 8, 2015

HTML - Pattern Matching

From HTML5, a pattern attribute has been introduced which allows validation of an input field using regular expression. The validation is carried out by the browser and no javascript is required. This is great news for developers as sometimes javascript validation becomes a tedious and repetitive task.

In this post, I will show how to use patterns in html forms with examples and then list a few common regular expression. Note that, in the example, I have not included a regular expression for email address. It's actually not required to validate email using regular expression and instead we can directly use the input type as email.

In this post, I will show how to read a single file from a password protected zip file and then display it on a web browser. This scenario might be more required in a windows application but since the focus is to read from the zip file than to display it on the web browser, I will go ahead with browser.

To read from the zip file, I am using a NuGet package - SharpZipLib. This library can ne used to read a password protected zip file. If you are not familiar on how to add or manage NuGet packages, then check the NuGet Docs. After the package is added, I will use the ICSharpCode.SharpZipLib.Zip to read the zip file.

Reference: Shahed Kazi at AspNetify.com