Friday, January 21, 2011

How to solve No animation on GIF file if submit a form in html?

Solution: Need to load gif file just before submit by JavaScript/JQuery

<input type="button" class="button" id="process" name="cmdFinish" value="Confirm" />
<div id="processinfo" style="display: none">

<script type= "text/javascript">
$("#process").click(function() {
document.getElementById('processinfo').innerHTML = '<img src= "images/load.gif" /> <br/>Processing...';
$("#processinfo").show();
$("form:first").submit();
});
</script>

How to convert DataTable into anonymous type class list for LINQ

System.Data.DataTable table = dataSet.Tables[0];
var GridviewData = from oneRow in table.AsEnumerable()
  select new
  {
  ID = oneRow.Field<Int32>("ID"),
  Amount = oneRow.Field<decimal>("Amount"),
  Description = oneRow.Field<string>("Description"),
  DateTime = oneRow.Field<System.DateTime?>("DateTime"),
  };