Date field disappears In ListView Control, when AJAX Masked Edit Extendar is used

Posted on 2009-04-23
Last Modified: 2012-05-06
Hi all,

I have a list view.In the Edit template , i have set a textbox to display a date field.

In the SQL server 2005 , the field is dateime field and is saved as "4/13/2009 12:00:00 AM"

I'm displaying only date(not time) in the Edit template textbox.

For this textbox, i have maskedEditExtender and MaskedEdit Validator.
When i click on Edit link in the listview, The date field disppears and displays a empty textbox.I know it is happening because of this extender.If i remove this extender, i get the textbox with the date , that is in database.

can somebody check with my html and let me know, where Am i going wrong??

Thanks for looking

<asp:TextBox ID="txtUpTravelStartDate" runat="server" Text='<%#Eval("StartDate")%>' Width="100px"></asp:TextBox>

                        <asp:ImageButton runat="Server" ID="ExImageUpStartDate" 


                            AlternateText="Click here to display calendar" CausesValidation="false"/>


                    <cc1:CalendarExtender ID="CalendarExUpStartDate" runat="server" 

                        TargetControlID="txtUpTravelStartDate" PopupButtonID="ExImageUpStartDate">


                    <asp:RequiredFieldValidator ID="ReqValUpStartDate" runat="server" Display="None" 

                    ErrorMessage="Travel Start Date Required" SetFocusOnError="True" 

                        ControlToValidate="txtUpTravelStartDate" ValidationGroup="TravelUpdate"/>

                    <cc1:ValidatorCalloutExtender ID="ExtenderReqValInsStartDate" runat="server" 

                        TargetControlID ="ReqValUpStartDate"/>

                    <cc1:MaskedEditExtender ID="MaskedEditExUpStartDate" runat="server"










                    <cc1:MaskedEditValidator ID="MaskedEditValUpStarDate" runat="server"

                        IsValidEmpty="False" ControlToValidate="txtUpTravelStartDate" 

                        EmptyValueMessage="Date is Required"

                        InvalidValueMessage="Date in Invalid"



                        Display="Dynamic" ControlExtender="MaskedEditExUpStartDate" ValidationGroup="TravelUpdate"></cc1:MaskedEditValidator>

Open in new window

Question by:SaraDob
    LVL 1

    Author Comment

    Anyone Please??!!
    LVL 83

    Expert Comment

    Is that intended?
    LVL 1

    Author Comment

    Newbie here in Ajax,
    I just follwed the example.....thats it..
    but when i removed it, the date field still does not appear in Edit mode.
    please help
    LVL 83

    Expert Comment

    Try commenting out the one of the 5 controls one by one and see if it has any effect.
    LVL 1

    Author Comment

    Thanks for the reply Codecruiser,
    It appears that The masked edit format of date is : "99/99/9999"
    Where as my dateformat in database(SQL Server 2005) is datetime format.
     I think its not showing because of this problem. Can you please let me know what can be done?
    LVL 83

    Accepted Solution

    If the format is not matching and you can not change the format in the database then you can stop using maskedit and instead use regular expression validator or customvalidator to validate the value.
    LVL 1

    Author Comment

    Okay....I will do that..
    Thanks again for help

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now