Skip to main content

Posts

Showing posts from August, 2012

Calculate No of Years,Months and Days Between two Dates by Javascript

Calculate No of Years,Months and Days Between two Dates by Javascript <script language="JavaScript"><!-- //function getAge(dateString,dateType) function CalbwDates() { /*    function getAge    parameters: dateString dateType    returns: boolean    dateString is a date passed as a string in the following    formats: Types :    type 1 : 19970529    type 2 : 970529    type 3 : 29/05/1997    type 4 : 29/05/97    dateType is a numeric integer from 1 to 4, representing    the type of dateString passed, as defined above.    Returns string containing the age in years, months and days    in the format yyy years mm months dd days.    Returns empty string if dateType is not one of the expected    values. */ //var FirstDate=document.getElementById('ctl00_ContentPlaceHolder1_TextBox1').value; //var SecondDate=document.getElementById('ctl00_ContentPlaceHolder1_TextBox2').value; var FirstDate=document.getElementById('TextBox1&

Get DataKey values in GridView RowCommand

Get DataKey values in GridView RowCommand pass the RowIndex via CommandArgument and use it to retrieve the DataKey value string Department = grdDetailsinst.DataKeys[row.RowIndex]["Usertype"].ToString(); string userid = grdDetailsinst.DataKeys[row.RowIndex]["Intuserid"].ToString();