Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

SQL
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))

        }



XML
<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>
Posted

1 solution

Add this code in page for Ajax Popup Calender

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



XML
<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">
 
Share this answer
 
Comments
[no name] 20-Feb-13 6:21am    
First u need to download ajaxtoolkit control add in your toolbox then only ajax Calender Ectender will be visible.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900