Entries for November 2009
This DateDiff function is used to calculate the date difference in months between 2 date.
How to use the DateDiff function:
var diff = DateDiff(fromDate, toDate)
document.write(diff.Years + ' years ' + diff.Months + ' months ' + diff.Days + ' days');
Source code:
var monthDay = new Array(31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
f...
continue reading »
Javascript function used to format number in currency format, for example: format 1000.25 as $1,000.25
function formatCurrency(num)
{
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num)) num = "0";
sign = (num == (num = Math.abs(num)));
...
continue reading »
My IIS suddenly does work with asp.net today, It shows me "Server Application Unavailable Error". I have tried "<WinDir>\Microsoft.NET\Framework\<Ver>\aspnet_regiis.exe -i" and "regsvr32 "<WinDir>\Microsoft.NET\Framework\<Ver>\aspnet_isapi.dll" but it does not work. After google a bit, I found it maybe user sercurity is...
continue reading »
Using JavaScript to automatically adjust the height of iFrames on your page(s)
This javascript was tested on IE and FF, It works fine.
1. Html Code for IFrame
<iframe id="frameContent" name="frameContent" onload="return IframeOnload('frameContent');" class="adm_iframe" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></if...
continue reading »
How to fix GridView's Header row while scrolling?
I googled a lot, find some are using expression wich only work for IE and the performance is bad. Some are using TBody scroll, which also does not work well in all browsers. Also I found a JQuery plugin which is working very well in their demo page, but does not work for my case. Below i...
continue reading »