Monday, May 4, 2015

Friday, May 1, 2015

How to disable/enable buttons and links (jQuery + Bootstrap)

jQuery.fn.extend({
   disable: function (state) {
      return this.each(function () {
         var $this = jQuery(this);
         if ($this.is('input, button'))
            this.disabled = state;
         else if($this.is('a'))
            $this.toggleClass('disabled', state);
      });
   }
});

Thursday, April 30, 2015

Monday, April 20, 2015

Using DataBinder.Eval in the RowDataBound Event asp net gridview

decimal totalAmount = 0;
protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
 totalAmount += Decimal.Parse(DataBinder.Eval(e.Row.DataItem, "Amount").ToString());
}
}

Sunday, April 19, 2015