2011-03-29 6 views
0

안녕하세요, iv 항공편을 예약 할 ASP 사이트가 있습니다. 캘린더에서 날짜를 선택하고 그 날짜를 텍스트 상자에 표시하면 날짜가 표시되지만 그 후에는 00:00 :ASP.NET 캘린더에서 표시 할 날짜와 시간 가져 오기

protected void Calendar_SelectionChanged(object sender, EventArgs e) 
{ 
    dayToFly = Convert.ToString(Calendar.SelectedDate.Date); 
    txtDate.Text = dayToFly; 
} 

protected void btnSelect_Click(object sender, EventArgs e) 
{ 
    dayToFly = Convert.ToString(Calendar.SelectedDate.Date); 
    destination = dropDestinations.SelectedValue; 
    amountofpeople = Convert.ToInt16(dropAmount.SelectedValue); 

    lblInfo.Text = "You would like to Fly on " + dayToFly + " to " + 
     destination + " with " + amountofpeople + " people"; 
} 

답변

1

당신이 표준 ASP.NET 달력 컨트롤을 사용하고 여기 00

그 비트에 대한 내 코드? 그렇다면 시간 만 연관 지어서 날짜를 알려줄 것입니다. 그래서 그 시간에 '00 : 00 : 00 '을 얻습니다.

아마도 사용자는 날짜와 시간을 모두 선택할 수있는 타사 날짜/시간 선택기 컨트롤을 사용해야 할 것입니다. 나는 직장에서 Telerik 1을 사용하지만, $$$의 비용이 든다.

http://demos.telerik.com/aspnet-ajax/calendar/examples/overview/defaultcs.aspx

은 비록 사용할 수없는 사람이있다 확신합니다.

관련 문제