Wednesday, July 10, 2013

In Visual Studio, how to make post build event only happening in DEBUG mode?

Add a condition like:
if $(ConfigurationName) == Debug "$(TargetDir)i18n.PostBuild.exe" "$(ProjectDir)"

Formula.js

JavaScript implementation of most formula functions supported by Microsoft Excel 2013 and Google Spreadsheets


http://stoic.com/formula/

Monday, July 8, 2013

How to do server side validation for ASP.NET MVC Model?

Implement IValidatableObject interface inside model :

public System.Collections.Generic.IEnumerable Validate(ValidationContext validationContext)
 {
            if(true)
            {
                yield return new ValidationResult("error message", new string[] { "Validated Object Name" });                
            }
 }


http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.ivalidatableobject.validate.aspx