Basic Date Picker Documentation

BasicDatePicker.OnClientBeforeSelectionChanged Property

Custom JavaScript function which is fired just before internal client-side SelectionChanged Event is fired. Example: BasicDatePicker1.OnClientBeforeSelectionChanged = "myCustomBeforeChangedFunction";

[Visual Basic]
Public Property OnClientBeforeSelectionChanged As String
public string OnClientBeforeSelectionChanged {get; set;}

Property Value

A string that represents the custom JavaScript function name to be called. The default value is String.Empty.


The following table lists the parameters that are passed by default to the custom OnClientBeforeSelectionChanged JavaScript function.

Parameter Description
sender A client-side instance of the BasicDatePicker control.
newVisibleDate The first day of the new visible month.

The following table lists all properties available through the sender (BasicDatePicker) client-side JavaScript object.

Property Description
viewingYear Returns the year of the current visible month. Example: var visibleYear = sender.viewingYear
viewingMonth Returns the month of the current visible month. Example: var visibleMonth = sender.viewingMonth
selectedYear Returns the year of the SelectedDate. Example: var currentSelectedYear = sender.selectedYear
selectedMonth Returns the month of the SelectedDate. Example: var currentSelectedMonth = sender.selectedMonth
selectedDay Returns the day number of the SelectedDay. Example: var currentSelectedDay = sender.selectedDay

The following table lists all functions available through the client-side JavaScript API.

JavaScript Function Description
getControlId() Gets the Id of the currently instantiated date picker.
formatDate(date) Returns the date as a formatted string as per DateFormat or DateFormat properties.
parseDate(dateAsString) Returns a Date object of the string supplied. Formats as per DateFormat or DateFormat properties.
setSelectedDate(date) Set the SelectedDate of the current date picker.
setSelectedDate(date, datePickerId) Set the SelectedDate of another date picker.
getSelectedDate() Get the SelectedDate of the current date picker as a Date object.
getSelectedDate(datePickerId) Get the SelectedDate of another date picker as a Date object.
getSelectedDateFormatted() Get the SelectedDate as a formatted string of the current BasicDatePicker. Same formatted value which appears in the textbox.
getSelectedDateFormatted(datePickerId) Get the SelectedDate as a formatted string of another BasicDatePicker. Same formatted value which appears in the textbox.
getEnabled() Get boolean(true/false) of Enabled status of current BasicDatePicker.
getEnabled(datePickerId) Get boolean(true/false) of Enabled status of another BasicDatePicker.
setEnabled(bool) Set Enabled status of current BasicDatePicker.
setEnabled(bool, datePickerId) Set Enabled status of another BasicDatePicker.

The following helper functions extend the JavaScript Date object.

JavaScript Date Helper Function Description (Extends Date Object)
Date.addDays(numberOfDays) Add specified number of days to a Date.
Date.addMonths(numberOfMonths) Add specified number of Months to Date object.
Date.addYears(numberOfYears) Add specified number of Years to Date object.
Date.addHours(numberOfHours) Add specified number of Hours to Date object.
Date.addMinutes(numberOfMinutes) Add specified number of Minutes to Date object.
Date.addSeconds(numberOfSeconds) Add specified number of Seconds to Date object.

The following is a full list of all params availble client-side.

Parameter Property Reference
autoPostBack See AutoPostBack
buttonText See ButtonText
calendarStyle See CalendarStyle
calendarStyleCssClass See CalendarStyle
culture See Culture
dateFormat See DateFormat
dayHeaderStyle See DayHeaderStyle
dayHeaderStyleCssClass See DayHeaderStyle
dayNameFormat See DayNameFormat
dayStatusBarText See DayStatusBarText
dayStyle See DayStyle
dayStyleCssClass See DayStyle
openCalendarOnTextBoxFocus See OpenCalendarOnTextBoxFocus
datePickerDisplayType See DatePickerDisplayType
downYearSelectorImageFileName See DownYearSelectorImageFileName
downYearSelectorText See DownYearSelectorText
enabled See Enabled
firstDayOfWeek See FirstDayOfWeek
footerStyle See FooterStyle
footerStyleCssClass See FooterStyle
footNoteStyle See FootNoteStyle
footNoteStyleCssClass See FootNoteStyle
footNoteText See FootNoteText
forceSixRows See ForceSixRows
maximumDate See MaximumDate
minimumDate See MinimumDate
monthSelectorEnabled See MonthSelectorEnabled
monthSelectorXOffset See MonthSelectorXOffset
monthSelectorYOffset See MonthSelectorYOffset
nextMonthImageFileName See NextMonthImageFileName
nextMonthText See NextMonthText
nextPrevFormat See NextPrevFormat
nextPrevMonthImageHeight See NextPrevMonthImageHeight
nextPrevMonthImageWidth See NextPrevMonthImageWidth
nextPrevStyle See NextPrevStyle
nextPrevStyleCssClass See NextPrevStyle
noneButtonStyle See NoneButtonStyle
noneButtonStyleCssClass See NoneButtonStyle
noneButtonText See NoneButtonText
nullDateText See NullDateText
onClientAfterCalendarOpen See OnClientAfterCalendarOpen
onClientBeforeCalendarOpen See OnClientBeforeCalendarOpen
onClientBeforeCalendarClose See OnClientBeforeCalendarClose
onClientAfterSelectionChanged See OnClientAfterSelectionChanged
onClientAfterVisibleMonthChanged See OnClientAfterVisibleMonthChanged
onClientBeforeSelectionChanged See OnClientBeforeSelectionChanged
onClientBeforeVisibleMonthChanged See OnClientBeforeVisibleMonthChanged
onClientDayRender See OnClientDayRender
otherMonthDayStyle See OtherMonthDayStyle
otherMonthDayStyleCssClass See OtherMonthDayStyle
popUpStyle See PopUpStyle
popUpStyleCssClass See PopUpStyle
prevMonthImageFileName See PrevMonthImageFileName
prevMonthText See PrevMonthText
selectableNextMonthDays See SelectableNextMonthDays
selectablePrevMonthDays See SelectablePrevMonthDays
selectableWeekDays See SelectableWeekDays
selectableWeekendDays See SelectableWeekendDays
selectedDayStyle See SelectedDayStyle
selectedDayStyleCssClass See SelectedDayStyle
showDayHeader See ShowDayHeader
showDaysInNextMonth See ShowDaysInNextMonth
showDaysInPrevMonth See ShowDaysInPrevMonth
showNextPrevMonth See ShowNextPrevMonth
showNoneButton See ShowNoneButton
showTitle See ShowTitle
showTodayButton See ShowTodayButton
showWeekNumbers See ShowWeekNumbers
specialDates See SpecialDates
titleStyle See TitleStyle
titleStyleCssClass See TitleStyle
todayButtonStyle See TodayButtonStyle
todayButtonStyleCssClass See TodayButtonStyle
todayButtonText See TodayButtonText
todayDayStyle See TodayDayStyle
todayDayStyleCssClass See TodayDayStyle
twoDigitYearBreak See TwoDigitYearBreak
upDownYearSelectorFormat See UpDownYearSelectorFormat
upDownYearSelectorImageHeight See UpDownYearSelectorImageHeight
upDownYearSelectorImageWidth See UpDownYearSelectorImageWidth
upYearSelectorImageFileName See UpYearSelectorImageFileName
upYearSelectorText See UpYearSelectorText
visibleDate See VisibleDate
weekendDayStyle See WeekendDayStyle
weekendDayStyleCssClass See WeekendDayStyle
weekNumberStyle See WeekNumberStyle
weekNumberStyleCssClass See WeekNumberStyle
xOffset See XOffset
yearSelectorEnabled See YearSelectorEnabled
yearSelectorXOffset See YearSelectorXOffset
yearSelectorYOffset See YearSelectorYOffset
yOffset See YOffset

See Also

BasicDatePicker Class | BasicFrame.WebControls Namespace | OnClientDayRender | OnClientBeforeCalendarOpen | OnClientAfterCalendarOpen | OnClientBeforeCalendarClose | OnClientAfterSelectionChanged | OnClientBeforeVisibleMonthChanged | OnClientAfterVisibleMonthChanged