Tuesday, March 13, 2012

jquery get asp.net label text

var labelText = $('#<%= lblabc.ClientID %>').html();

jquery find server control checkbox checked state

if ($('#isAgeSelected').is(':checked')){
//your code here
}

Friday, March 09, 2012

tsql get part of a datetime value

DATEPART(portion, datetimevalue)

the options for portion are:

Ms for Milliseconds
Yy for Year
Qq for Quarter of the Year
Mm for Month
Dy for the Day of the Year
Dd for Day of the Month
Wk for Week
Dw for the Day of the Week
Hh for Hour
Mi for Minute
Ss for Second

e.g.
select startdate,DATEPART(Hh,a.startdate)

this returns the hour of startdate