Solved

MaskedEditExtender and  ValidatorCalloutExtender

Posted on 2010-08-31
6
1,646 Views
Last Modified: 2012-05-10

Hi Experts
I am using MaskedEditExtender and  ValidatorCalloutExtender,but having problems with it.
The validation fires even if date is correct.

<asp:TextBox ID="txtFromDate" Width="80px" CssClass="inputdate" runat="server"></asp:TextBox>
                                    <cc1:MaskedEditExtender ID="MEEFromDate" runat="server" Mask="99/99/9999" MaskType="Date"
                                        UserDateFormat="MonthDayYear" TargetControlID="txtFromDate" PromptCharacter="_">
                                    </cc1:MaskedEditExtender>
                                    <cc1:CalendarExtender ID="ceFromDate" runat="server" Enabled="True" Format="MM/dd/yyyy"
                                        TargetControlID="txtFromDate">
                                    </cc1:CalendarExtender>
                                    <cc1:MaskedEditValidator ValidationGroup="Professional" ID="MEVFromDate" runat="server"
                                        ControlExtender="MEEFromDate" Display="None" ControlToValidate="txtFromDate" EmptyValueMessage="Please enter valid date"
                                        InvalidValueMessage="Please enter valid date" IsValidEmpty="False" TooltipMessage="Input a Date"></cc1:MaskedEditValidator>
                                    <cc1:ValidatorCalloutExtender ID="MEVFromDate_ValidatorCalloutExtender" runat="server"
                                        Enabled="True" TargetControlID="MEVFromDate" WarningIconImageUrl="~/Images/ErrorProvider.gif"
                                        Width="150px">
                                    </cc1:ValidatorCalloutExtender>

Whats going wrong here?
0
Comment
Question by:johny_bravo1
  • 3
  • 3
6 Comments
 
LVL 21

Accepted Solution

by:
masterpass earned 500 total points
ID: 33623876
I think you need to have the ValidationGroup in the TextBox too

<asp:TextBox ID="txtFromDate" Width="80px" CssClass="inputdate" runat="server" ValidationGroup="Professional" />

ref : http://forums.asp.net/t/1296726.aspx
0
 
LVL 8

Author Comment

by:johny_bravo1
ID: 33624291
Thanks for your reply masterpass,
but still it is not working
0
 
LVL 21

Expert Comment

by:masterpass
ID: 33624534
Did you try the example from the link given ? works perfectly for me !!!
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 8

Author Comment

by:johny_bravo1
ID: 33625104
<asp:TextBox ID="txtFromDate" ValidationGroup="Professional" Width="80px" CssClass="inputdate"
                                        runat="server"></asp:TextBox>
                                    <cc1:MaskedEditExtender ID="MEEFromDate" runat="server" Mask="99/99/9999" MaskType="Date"
                                        UserDateFormat="MonthDayYear" TargetControlID="txtFromDate" PromptCharacter="_">
                                    </cc1:MaskedEditExtender>
                                    <cc1:CalendarExtender ID="ceFromDate" runat="server" Enabled="True" Format="MM/dd/yyyy"
                                        TargetControlID="txtFromDate">
                                    </cc1:CalendarExtender>
                                    <cc1:MaskedEditValidator ValidationGroup="Professional" ID="MEVFromDate" runat="server"
                                        ControlExtender="MEEFromDate" Display="None" ControlToValidate="txtFromDate"
                                        EmptyValueMessage="Please enter valid date" InvalidValueMessage="Please enter valid date"
                                        IsValidEmpty="False" TooltipMessage="Input a Date"></cc1:MaskedEditValidator>
                                    <cc1:ValidatorCalloutExtender ID="MEVFromDate_ValidatorCalloutExtender" runat="server"
                                        Enabled="True" TargetControlID="MEVFromDate" WarningIconImageUrl="~/Images/ErrorProvider.gif"
                                        Width="150px">
                                    </cc1:ValidatorCalloutExtender>

This is what I am doing,but gets the message every time even if the date is in correct format
0
 
LVL 21

Expert Comment

by:masterpass
ID: 33625113
Does that example work for you ?
0
 
LVL 8

Author Closing Comment

by:johny_bravo1
ID: 33625398
Thanks it works fine.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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