• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 642
  • Last Modified:

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

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" 
                            ImageUrl="../Images/popup-calendar.GIF" 
                            AlternateText="Click here to display calendar" CausesValidation="false"/>
                    </td>
                    <cc1:CalendarExtender ID="CalendarExUpStartDate" runat="server" 
                        TargetControlID="txtUpTravelStartDate" PopupButtonID="ExImageUpStartDate">
                    </cc1:CalendarExtender>
                    <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"
                        TargetControlID="txtUpTravelStartDate"
                        Mask="99/99/9999"
                        OnFocusCssClass="MaskedEditFocus" 
                        OnInvalidCssClass="MaskedEditError"
                        MessageValidatorTip="true"
                        MaskType="Date" 
                        InputDirection="RightToLeft" 
                        ErrorTooltipEnabled="True">
                    </cc1:MaskedEditExtender>
                    <cc1:MaskedEditValidator ID="MaskedEditValUpStarDate" runat="server"
                        IsValidEmpty="False" ControlToValidate="txtUpTravelStartDate" 
                        EmptyValueMessage="Date is Required"
                        InvalidValueMessage="Date in Invalid"
                        EmptyValueBlurredText="*" 
                        InvalidValueBlurredMessage="*" 
                        Display="Dynamic" ControlExtender="MaskedEditExUpStartDate" ValidationGroup="TravelUpdate"></cc1:MaskedEditValidator>

Open in new window

0
SaraDob
Asked:
SaraDob
  • 4
  • 3
1 Solution
 
SaraDobAuthor Commented:
Anyone Please??!!
0
 
CodeCruiserCommented:
>InputDirection="RightToLeft"
Is that intended?
0
 
SaraDobAuthor Commented:
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
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
CodeCruiserCommented:
Try commenting out the one of the 5 controls one by one and see if it has any effect.
0
 
SaraDobAuthor Commented:
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?
 
0
 
CodeCruiserCommented:
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.
0
 
SaraDobAuthor Commented:
Okay....I will do that..
Thanks again for help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now