2

Closed

MaskedEditValidator can't make use of MaskedEditExtender's UserDateFormat property

description

version 1.0.11119.0
when we define UserDateFormat of MaskedEditExtender, MaskedEditValidator will make use of UserDateFormat property, but it is using wrong format..
the code in MaskedEditValidator.cs , line 528 is wrong.
AttibFmt = (MaskExt.UserDateFormat == MaskedEditUserDateFormat.None ? AttibFmt : MaskExt.UserDateFormat.ToString());

In our usage, we just change it to
AttibFmt = (MaskExt.UserDateFormat == MaskedEditUserDateFormat.None ? AttibFmt : ToDMY(MaskExt.UserDateFormat));

and added a help function ToDMY
     public string ToDMY(MaskedEditUserDateFormat fmt)
    {
        string ret = "DMY";
        switch (fmt)
        {
            case AjaxControlToolkit.MaskedEditUserDateFormat.DayMonthYear:
                ret = "DMY";
                break;
             .....
        }
        return ret;
    }

file attachments

Closed May 3, 2013 at 7:08 AM by Superexpert
Issues is closed as it is fixed with April 2013 release.

comments

WilsonLo wrote Jul 30, 2010 at 3:54 PM

Esta solucion es funcional sino hacen postback, pero si quieren editar fechas o mantener el contenido en un postback de la forma se daña el formato, para evitar el error de la validación sin usar CultureName en el control es necesario modificar el archivo MaskedEditBehavior.js reviewed line 3390 (ConvFmtDate funtion)

Perdon por el mal ingles.