Saturday, June 12, 2010

asp.net: How to disable asp.net button after clicked

1st step: Create Java script function to disable the button



function disableBtn(btnID, newText) {
var btn = document.getElementById(btnID);
setTimeout("setImage('"+btnID+"')", 10);
btn.disabled = true;
btn.value = newText;

}

2nd step:
Call onclientclick action for the button

OnClientClick="disableBtn(this.id, 'Upload data ')" UseSubmitBehavior="false"
Oralce SQL:
Select the maximum date from each month in a date column .
column named (date_col) contains dates and you would like to select the maximum date from each month in this column.

select max(date_col)
from table_name
group by to_char(date_col,'mm'),to_char(date_col,'yyyy')
ORACEL SQL.
How to List dates between two dates interval

select to_date('Start_date','dd-mm-yyyy') + rownum -1
from all_objects
where rownum <= to_date('End_date','dd-mm-yyyy')-to_date('Start_date','dd-mm-yyyy')+1