用jQuery日历替换asp.net中的Calendar控件(它的事件)?

时间:2014-07-04 10:12:24

标签: c# asp.net events calendar jquery-ui-datepicker

之前标题:如何在网页中添加每周视图日历条带?

Gridview 的数据按一年中的搜索和显示。每周视图日历控件应该看起来像下面显示的图片。当前月份,周和日期会突出显示。

添加日历控件并根据用户在C#中单击的日期计算一年中的一周不是问题。但是我需要以这种方式格式化日历控制以突出显示当年的当前周,并提供导航到一年中的下一周和前几周(连续)。

在ASP.Net页面中,我该如何实现?

enter image description here

编辑 [2014年7月17日]

在获得一些关于Asp.Net的新手,并对jQuery有点了解之后,我意识到这可以通过其UI中的jQuery DatePicker轻松实现。但是,当迁移基于默认asp.net Calendar控件的代码以使用jQuery DatePicker 时,我需要解决几个问题。

  1. jQuery DatePicker也被称为jQuery Calendar吗?
  2. 可以在jQuery DatePicker中实现以下事件吗?

       //event                      
       protected void Calendar1_SelectionChanged(object sender, EventArgs e)
       {
            ShowData("a");            
       }
    
       //method is used with page load event to get the data for current week (default)
       Calendar1.SelectedDate
    
    //event - user can only select a particular week, not the single date
    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        e.Day.IsSelectable = false;
    }
    
  3. Is it possible to get the selected week/date of the jQuery DatePicker into a variable? YES

  4. 将问题转换为jQuery而不是使用内置日历控件来实现应用程序的维护目的。

0 个答案:

没有答案