Posts

Showing posts from May, 2013

C# Enum with readable string

public enum MerchantType        {             [Description("Master merchant")]             mastermerchant,             [Description("Merchant")]             merchant,             [Description("Terminal")]             terminal,                         error,         } public static string GetDescription ( this Enum value ) { if ( value == null ) { throw new ArgumentNullException ( "value" ); } string description = value . ToString (); FieldIn...

JQuery checkbox checking

Sometimes Jquery.attr('checked','checked') does not work for many cases. Jquery newest attribute manipulator .prop() can be used as follows checking   $(document).ready(function(){     $('#btn').click(function(){        $('#chk').removeProp('checked');        $('#chk').prop('checked','checked');     });  }); http://jsfiddle.net/yxCnK/