views:

181

answers:

1

Hi,

I am using a MaskedEditExtender on a textbox to verify a date. MaskType="Date" Mask="99/99/9999". Users of the system are used to typing just the last two digits of the year (i.e. 22/06/10) so I am trying to make this possible.

I have tried using Century="2000" but this option does not seem to function at all (still results in 22/06/0010).

A response in another forum suggests modifying the MaskedEditBehavior.js file to fix this behaviour - see here.

My question is, how should I go about modifying the MaskedEditBehavior.js file (as suggested in the link above), and how do I ensure that this modification is distributed with my application? I cannot even find this file to modify.

Many thanks,

Tom

A: 

set this <cc1:CalendarExtender Format="dd/MM/yyyy" to your calendear extender

Edit: then add this method in your code behind and try..

protected override void InitializeCulture()
{
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
    base.InitializeCulture();
}
Muhammad Akhtar
Hi Muhammad,I am not using a Calendar Extender. My question relates to use of the Masked Edit Extender and a Text Box.
Tom
and make sure to add this using System.Globalization;using System.Threading;
Muhammad Akhtar
Muhammad,I have tried what you suggested, but the date still defaults to 22/06/0010 and not 22/06/2010 even though I have set Century="2000".I think that the link in my original post does provide the best solution, my question was how can I implement it (by modifying MaskedEditBehavior.js)?
Tom
remove this and try Century="2000"
Muhammad Akhtar
As I said, using Century="2000" has no effect. It seems that this option is non-functional.
Tom