2015-01-09 179 views

回答

0

我更喜歡使用自己的控制,而不是sp日期控制。

var dateControl = new DateTimeControl(); 
dateControl.ID = "anyId"; 
dateControl.DateOnly = true;   
dateControl.CssClassTextBox = "cssclass"; 
dateControl.LocaleId = Convert.ToInt32(SPContext.Current.RegionalSettings.LocaleId); 
dateControl.OnValueChangeClientScript = "onApplyDateChangeValue(event)"; 

//if you want to set any value 
dateControl.SelectedDate = DateTime.ParseExact("dateString", "dd.MM.yyyy",CultureInfo.InvariantCulture); 

//Add to app page   
"elementID".Controls.Add(dateControl); 
0

它工作在以下方面點擊功能代碼罰款

寫的:if(!spCal2.IsDateEmpty) { lblShowdtae.Text = dtSPdate.SelectedDate.ToString() ; }