3
Answers

CalenderExtender Was not showing all dates.

Rajesh Kumar

Rajesh Kumar

12y
2.4k
1
Hello there,

I have a problem with Calender Extender in AJAX Toolkit in Visual studio 2008. i.e that calender extender was not showing all dates for all months.
It was showing just Sunday & Monday dates in first and last columns in that box remaining dates was not appearing in this box. this problem occurs in every months dates. Kindly help to resolve it.

Thanks.. 
Answers (3)
0
Ram kumar

Ram kumar

NA 43 13.5k 12y
Please try this


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Date.aspx.cs" Inherits="page1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<html>
<head id="Head1" runat="server">
    <title></title>
   
</head>
<body>
    <form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="tool1" runat="server">
    </asp:ToolkitScriptManager>
    <table>
        <tr>
            <td>
                Empno:
            </td>
            <td style="margin-left: 40px">
                <asp:TextBox ID="TxtEmpno" onkeypress="return isNumberKey(event);" runat="server"
                    Width="300px" MaxLength="6"></asp:TextBox>
            </td>
            <td style="margin-left: 40px">
                &nbsp;&nbsp;&nbsp; &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                From Date :
            </td>
            <td>
                <asp:TextBox ID="TxtDateFrom" runat="server" CssClass="txtbox"></asp:TextBox>
                <asp:ImageButton ID="Img_DateFrom" runat="server" ImageUrl="~/Images/1.jpg" AlternateText="Click here to display the calender"
                    align="center" Height="25px" Width="43px" />
            </td>
            <td>
                <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TxtDateFrom"
                    MaskType="Date" Mask="99/99/9999" MessageValidatorTip="true" InputDirection="LeftToRight"
                    ErrorTooltipEnabled="True" AcceptNegative="None">
                </asp:MaskedEditExtender>
                <asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender1"
                    ControlToValidate="TxtDateFrom" IsValidEmpty="true" ForeColor="Red" EmptyValueMessage="Enter Date Value"
                    InvalidValueMessage="Date Fromat should be (MM/dd/yyyy)." InvalidValueBlurredMessage="Date Format (MM/dd/yyyy)."
                    EmptyValueBlurredText="*" Display="None">
                </asp:MaskedEditValidator>
                <asp:CalendarExtender ID="CalendarExtender1" Format="MM/dd/yyyy" runat="server" TargetControlID="TxtDateFrom"
                    PopupButtonID="Img_DateFrom" />
                <asp:ValidatorCalloutExtender ID="VCEField1" runat="server" TargetControlID="MaskedEditValidator1">
                </asp:ValidatorCalloutExtender>
                <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="End date must be greater than start date"
                    Display="None" ControlToCompare="TxtDateFrom" ControlToValidate="TxtDateTo" Operator="GreaterThanEqual"
                    Type="Date"></asp:CompareValidator>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" TargetControlID="CompareValidator1">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                To Date :
            </td>
            <td>
                <asp:TextBox ID="TxtDateTo" runat="server" CssClass="txtbox"></asp:TextBox>
                <asp:ImageButton ID="Img_DateTo" runat="server" ImageUrl="~/Images/1.jpg" AlternateText="Click here to display the calender"
                    align="center" Height="26px" Style="margin-top: 0px" Width="43px" />
            </td>
            <td>
                <asp:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="TxtDateTo"
                    MaskType="Date" Mask="99/99/9999" MessageValidatorTip="true" InputDirection="RightToLeft"
                    AcceptNegative="None" ErrorTooltipEnabled="True">
                </asp:MaskedEditExtender>
                <asp:MaskedEditValidator ID="MaskedEditValidator2" runat="server" ControlExtender="MaskedEditExtender2"
                    ControlToValidate="TxtDateTo" IsValidEmpty="true" ForeColor="Red" EmptyValueMessage="Enter Date Value"
                    InvalidValueMessage="Date Fromat should be (MM/dd/yyyy)." Display="None" InvalidValueBlurredMessage="(MM/dd/yyyy)"
                    EmptyValueBlurredText="*">
                </asp:MaskedEditValidator>
                <asp:CalendarExtender ID="CalendarExtender2" Format="MM/dd/yyyy" runat="server" TargetControlID="TxtDateTo"
                    PopupButtonID="Img_DateTo">
                </asp:CalendarExtender>
                <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="MaskedEditValidator2">
                </asp:ValidatorCalloutExtender>
            </td>
        </tr>
        <tr>
            <td>
                Time :
            </td>
            <td>
                <asp:TextBox ID="txttime" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txttime"
                    MaskType="Time"  Mask="99:99:99" MessageValidatorTip="true" InputDirection="RightToLeft"
                    AcceptNegative="None" ErrorTooltipEnabled="True" AcceptAMPM="true">
                </asp:MaskedEditExtender>
            </td>
            <td>
                 <asp:MaskedEditValidator ID="MaskedEditValidator3" runat="server" ControlExtender="MaskedEditExtender3"
                    ControlToValidate="txttime" IsValidEmpty="true" ForeColor="Red" EmptyValueMessage="Enter Date Value"
                    InvalidValueMessage="Time  fomat wrong." Display="None" InvalidValueBlurredMessage="wrong"
                    EmptyValueBlurredText="***">
                </asp:MaskedEditValidator>
            </td>
            <td>
                <asp:Label ID="label2" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

0
Rajesh Kumar

Rajesh Kumar

NA 128 62.5k 12y
Hello, 

        I have one textbox and an calender extender. When i place cursor on textbox then the calender extender will apear clearly on one example webform. but shows wrong in another example. There is no code or source was not needed for this. 

Correct View: 


It Shows Wrong as below:


Thanks..
0
Ram kumar

Ram kumar

NA 43 13.5k 12y
can u send your source..which one have error