ValidateAntiForgeryToken: Purpose and Usage

In simple explanation found on Microsoft docs: ValidateAntiForgeryToken represents an attribute that is used to prevent forgery of a request. In other terms this attribute is used to prevent cross-site forgery attacks. Cross site forgery is an attack that posts to your site/form to attempt to submit a hiddent content using an authenticated user’s credential. Let’s have a realistic scenario of this cross site forgery. Supposed you are logged in to your online banking account....

September 17, 2013 · 2 min · Jommel Colcol

Visual Studio Project Types

Today, I encountered an error/bug on my Visual Studio. Working with the MVC project I am doing, while trying to add a scaffolding controller. I can’t seem to find the ‘Add Controller’ in the context menu of Controller folder. Sometimes a simple Clean all, Rebuild all works easily. Sometimes it’s just a bug on Visual Studio itself and a simple reboot of VS or reboot of your machine will work....

November 19, 2013 · 1 min · Jommel Colcol

WPF Implementing Validation INotifyDataErrorInfo

INotifyDataErrorInfo Before diving into implementation of INotifyDataErrorInfo, make sure you have a good grasp of WPF Data Binding. 3 important usage/returns of INotifyDataErrorInfo interface: HasErrors - bool property that is binded when the Model has any error. GetErrors - IEnumberable ErrorsChanged - Event Let’s create a model (Person class) that implements INotifyDataErrorInfo class Person : INotifyDataErrorInfo { public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public System.Collections.IEnumerable GetErrors(string propertyName) { } public bool HasErrors { get { return true; } } } Let’s define a dictionary errors...

December 12, 2013 · 1 min · Jommel Colcol

C# Concatenation: The Good, The Bad and The Ugly

Background In my current previous full time job, majority of the tasks we have are concerning about string manipulation. The applications that we are creating and maintaining are tools use by our journals team. Our clients are multinational publishing companies that are producers of online journals, books and research resources. We automate journals analysts tasks related to XML, HTML formattings etc. Most of our business logic tasks involve string manipulation, we manipulate a lot of text....

April 12, 2013 · 3 min · Jommel Colcol