asp.net中的ajax calander [英] ajax calander in asp.net

查看:90
本文介绍了asp.net中的ajax calander的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨这是pradeep我正在使用ajax modelpopupextender,因为我正在使用OnClientDateSelectionChanged和onclientshown函数但是我在使用OnClientDateSelectionChanged时没有得到modelpopup我得到了modelpopup窗口我应该怎样做请任何人告诉我



这是我的代码



  function  calendarShown(sender,args){
sender._popupBehavior._element.style.zIndex = 10005 ;
}

function checkdate(sender,args){

if (sender._selecteddate< = new date ()|| sender._selecteddate> new date ()){
alert( 你不能提前一天选择! );
sender._selecteddate = new date ();
// 设置 日期返回 当前 date
sender._textbox.set_value(sender._selecteddate.format( sender._format))

}







 <   asp:TextBox     ID   =  txtenddate    runat   = 服务器 >  <   / asp:TextBox  >  
<% - < asp:ImageButton ID = ImageButton3 runat = server ImageUrl = 〜/ Images / calendar.gif AlternateText = 请点击这里显示日历 /> - %>
< ajax:CalendarExtender ID = CalendarExtender2 runat = server 格式 = MMMM d,yyyy

< span class =code-attribute> 动画 = true PopupPosition = BottomLeft TargetControlID = txtenddate OnClientDateSelectionChanged = checkdate OnClientShown = calendarShown >
< / ajax:CalendarExtender >

解决方案

在页面中为Ajax Popup Calender添加此代码



 <   asp:ScriptManager    < span class =code-attribute> ID   =  ScriptManager1    runat   = 服务器 >  
< / asp:ScriptManager >







 <   asp:TextBox  < span class =code-attribute>   ID   =  TxtFdate    runat   =  server   宽度  =  142px  

工具提示 = Clict To Select Start Date AutoPostBack = True

ontextchanged = TxtFdate_TextChanged > < / asp:TextBox >
< asp:CalendarExtender ID < span class =code-keyword> = TxtFdate_CalendarExtender runat = server

已启用 = True TargetControlID = TxtFdate 格式 = yyyy-MM-dd > < /跨度>


hi this is pradeep i am using ajax modelpopupextender in that i am using OnClientDateSelectionChanged and onclientshown functions but i am not getting modelpopup while using OnClientDateSelectionChanged with out this i am getting modelpopup window what should i do please anyone tell me

here is my code

function calendarShown(sender, args) {
        sender._popupBehavior._element.style.zIndex = 10005;
    }

    function checkdate(sender, args) {

        if (sender._selecteddate <= new date() || sender._selecteddate > new date()) {
            alert("you cannot select a day earlier than today!");
            sender._selecteddate = new date();
           // set the date back to the current date
            sender._textbox.set_value(sender._selecteddate.format(sender._format))

        }




<asp:TextBox ID="txtenddate" runat="server"></asp:TextBox>
             <%-- <asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/Images/calendar.gif" AlternateText="Click here to display calendar"/>--%>
                    <ajax:CalendarExtender ID="CalendarExtender2" runat="server" Format="MMMM d, yyyy"

                                            Animated="true" PopupPosition="BottomLeft" TargetControlID="txtenddate" OnClientDateSelectionChanged="checkdate"  OnClientShown="calendarShown">
                                        </ajax:CalendarExtender>

解决方案

Add this code in page for Ajax Popup Calender

<asp:ScriptManager ID="ScriptManager1" runat="server">
   </asp:ScriptManager>




<asp:TextBox ID="TxtFdate" runat="server" Width="142px"

               ToolTip="Clict To Select Start Date" AutoPostBack="True"

               ontextchanged="TxtFdate_TextChanged"></asp:TextBox>
           <asp:CalendarExtender ID="TxtFdate_CalendarExtender" runat="server"

               Enabled="True" TargetControlID="TxtFdate" Format="yyyy-MM-dd">


这篇关于asp.net中的ajax calander的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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