Calende时间控件怎么邦定数据库的时间型数据字段呀??

解决方案 »

  1.   

    在它的DataBinding事件中手工绑定,或者写类似<asp:Calendar id=Calendar1 runat="server" SelectedDate="<%# DateTime.Now %>">的代码。这个类不支持DataSource这样的属性,所以搞起来不是那么方便。
      

  2.   

    比方说你可以在Code-behind class中实现一个public DateTime GetDateTimeByCurrentDataRow();然后
    <asp:Calendar id=Calendar1 runat="server" SelectedDate="<%# GetDateTimeByCurrentDataRow()%>">
      

  3.   

    public DateTime GetDateTimeByCurrentDataRow();
    要实现这个方法的怎么编写代码呢 是调用库吗???
      

  4.   

    简单的例子,直接写在页面里:
    <script language=C# runat=server>
    void GetDateTimeByCurrentDataRow()
    {
    return DateTime.Now;
    }
    </script>