The issue is that you need both the data and the time to be populated before you do a postback, but you want to postback as soon as these details are complete. Here's one way this can be done:
$.(function(){
var startTextBox = $("#tbxStartDate");
var startTimeDropDown = $("#ddlStartTime");
$(startTextBox).on('input propertychange paste', function(event){
event.preventDefault();
validateStartDateTime(startTextBox,startTimeDropDown );
});
$(startTimeDropDown ).on('change', function(){
validateStartDateTime(startTextBox,startTimeDropDown );
});
});
function validateStartDateTime (dateTextBox, timeDropDown){
__doPostBack("tbxStartDate","TextChanged");
}
....
EDIT: As for the database search:
public void test(){
DateTime startDateTime = DateTime.ParseExact(txtStartDate.Text,"dd-MM-yyy",CultureInfo.InvariantCulture)
+ TimeSpan.ParseExact(ddlStartTime.SelectedText, "HH:mm", CultureInfo.InvariantCulture);
DateTime endDateTime = DateTime.ParseExact(txtEndDate.Text,"dd-MM-yyy",CultureInfo.InvariantCulture)
+ TimeSpan.ParseExact(ddlEndTime.SelectedText, "HH:mm", CultureInfo.InvariantCulture);
if(endDateTime > startDateTime)
throw new YouMadBroException();
string queryString = @"
Select *
From Bookings b
Where b.EndDateTime > @StartDateTime AND b.StartDateTime < @EndDateTime
";
}