有关AJax压光机控制的帮助 [英] Help about AJax calender control

查看:67
本文介绍了有关AJax压光机控制的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,我目前正在为我叔叔做一个项目.
关于牙科诊所项目
我已经在其中放置了在线约会工具,但是约会时遇到问题
[1].医生需要2天的时间来批准约会状态,因此当患者选择日期时,患者无法选择今天和明天的日期,我该如何使用Ajax时间/日期控件
例如:如果患者今天在2012年4月4日接受预约,则患者无法选择
Picker的4月6日和7日,请问这个操作方法如何告诉我
[2]在日期选择器中,最多显示2013年的限制.

请帮助我

Hello Friends i am currently making one project of my uncle.
It''s about dental clinic project
I have put online appointment facility in that but i have problem in appointment
[1]. Doctor take 2 day time to approve appointment status so while patient is selecting date patient can not select today and tomorrow date, how can i do using ajax time/date control
ex: if patient is taking appointment today on 6/4/2012 then patient can not select
6 and 7 april from picker, how to do this plz tell me
[2] in date picker , it show up to 2013 year limit not more then that.

Please help me
thanks in advance.

推荐答案

为了限制选择日期,您可以在ASP .net中使用Calendar控件的DayRender()事件,如下所示:
for restricting the date to be selected you can use DayRender() event of Calendar control in ASP .net as:
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
   {
       if (e.Day.Date > DateTime.Now.AddDays(1))
       {
           e.Day.IsSelectable = true;

       }
       else
       {
           e.Day.IsSelectable = false;
       }
   }



看看后面几页中提供的解决方案,您可能会有所了解:
http://forums.asp.net/p/1161833/2149277.aspx#2149277 [ ^ ]
http://forums.asp.net/t/1319318.aspx [


Or
have a look at the solutions provided in following pages you may get some idea :
http://forums.asp.net/p/1161833/2149277.aspx#2149277[^]
http://forums.asp.net/t/1319318.aspx[^]


使用以下代码.

JavaScript代码:
Use Following Code.

JavaScript Code :
function checkDate(sender, args)
        {

            var myDate = new Date();
            myDate.setDate(myDate.getDate() + 1);

            // Clear the time.
            myDate.setHours(0, 0, 0, 0);

            if (sender._selectedDate <=  new Date(myDate))
            {
                alert("You cannot select a day earlier than tomorrow !");
                sender._selectedDate = new Date(   myDate.setDate(myDate.getDate() + 1));
                // set the date back to the current date
                sender._textbox.set_Value(sender._selectedDate.format(sender._format))
            }
        }



HTML代码:



HTML Code:

<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
            <cc1:calendarextender id="CalendarExtender1" xmlns:cc1="#unknown">
            runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />
</cc1:calendarextender>



希望它对您有用.



Hope it will work for you.


这篇关于有关AJax压光机控制的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆