2014-11-19 2 views

답변

1

시간 구성 요소를 사용하도록 AjaxControlToolKit CalendarExtender를 "강제 설정"하는 방법은 OnClientDateSelectionChangedJavaScript을 사용하여 추가하는 것입니다.

<ajaxToolkit:CalendarExtender ID="ce1" runat="server" PopupButtonID="calImg" Enabled="true" Format="dd/MM/yyyy" TargetControlID="txtLeft" PopupPosition="TopRight" OnClientDateSelectionChanged="AppendTime"></ajaxToolkit:CalendarExtender> 

<script language="javascript" type="text/javascript"> 
     //this script will get the date selected from the given calendarextender (ie: "sender") and append the 
     //current time to it. 
     function AppendTime(sender, args){ 
      var selectedDate = new Date(); 
      selectedDate = sender.get_selectedDate(); 
      var now = new Date(); 
      sender.get_element().value = selectedDate.format("dd/MM/yyyy") + " " + now.format("HH:mm"); 
     } 
    </script> 
관련 문제