.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MaskedEditExtender multilanguage

Posted By:      Posted Date: September 26, 2010    Points: 0   Category :ASP.Net

<cc1:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender5" ControlToValidate="dobTextBox"ValidationExpression="^([0]\d|[1][0-2])\/([0-2]\d|[3][0-1])\/([2][01]|[1][6-9])\d{2}(\s([0-1]\d|[2][0-3])(\:[0-5]\d){1,2})?$" EmptyValueMessage="* Enter Date of Birth (MM/DD/YYYY)" InvalidValueMessage="* Enter Date of Birth (MM/DD/YYYY)"></cc1

View Complete Post

More Related Resource Links

Search Engines and Multilanguage Websites - using .resx


I have a website (asp.net 3.5+c# +linq ) having thopition to change languages (2) by the user, Am using the search engine like in the example of:


this search will find any searched word in all the pages and return the link in the default language of the site, but problem for the second language , because by default the site language is English and the user have the option to change to other language.

and as I understood that the .resx files can not be searched like the aspx by the search engines.

I looked in many blogs and discussion boards for similar  case but unfortunately no clues on this issue .
The only same case posted :


and also I could not find any clue to move on, 

 Kindly requsted to guide me for the soultio

Thanks for your time and wish you all the best
your help is always appreciated


MaskedEditExtender Gets Focus on Postback

I'm having a really strange issue with the MaskedEditExtnder. I've attached some markup for one of the textboxes. I'm using a MaskedEditExtender and MaskedEditValidator along with a CalendarExtender so the user has the option to type the date or click on an image and pick the date. So, if I enter/pick a date then select a control that forces a postback (usually a dropdownlist but not always) when the page is returned the focus goes back to the textbox I just entered the date in. So what about the MaskedEdit, MaskedEditValidator, CalendarExtender would cause the page to return focus to the control being extended? See markup below - am I missing something??  <asp:TextBox ID="txtEffectiveDate" runat="server" Width="100px" CssClass="textbox" AutoCompleteType="Disabled" Font-Bold="True"/> <asp:ImageButton ID="ImgBtnCalc1" runat="server" ImageUrl="~/images/Calendar_scheduleHS.png" CausesValidation="False"/> <cc1:MaskedEditExtender ID="txtEffectiveDate_MaskedEditExtender" runat="server" Enabled="True" TargetControlID="txtEffectiveDate" Mask="99/99/9999" MaskType=&qu

Multilanguage managed metadata filter

Hi, I wonder, how to create filter for view, using managed metadata in multiple languages. For example I have list with managed metadata column "color" with content "red", "yellow"... When I switch the language to german, it changes to "rot", "gelb" and so on for all other languages. Now I want to filter all list items with red color. But it doesn't work in other languages. So question is, how to set value of the managed metadata column? If it is "red", I switch to german language and it doesn't work. When I set "red" or "rot" it works, but it is nonsense set all filters for all languages and change it every time you add new language pack (we need 15 languages). Is there any possibility to filter items by key and not actuall value in actuall language? Thanks.  

Javascript to disable MaskedEditExtender

Hi all, can anyone show me how to use javascript to disable maskededitextender? I have a province/state dropdownlist which has all the canadian provinces+US states + australian provinces. The postalcode/state mask for canadian province is 'L9L 9L9' and the postalcode/state mask for US state is '99999-9999' while austrialian province should have no mask at all.  So far i'm able to change the mask properly when the user selects a canadian province or an US state but i don't know how to use javascript to disable the maskededitextender when the user selects an Austrialian province. Any help is appreciated. Thanks!

Can't get MaskedEditExtender/Validator to work

After about two hours of fiddling with it myself and searching the 'Net for anything that would help, I haven't run across anything that seems to help. Here's my code:<ajaxToolkit:MaskedEditExtender ID="editExtSSN" runat="server" TargetControlID="txtInsSSN" Mask="999-99-9999" MaskType="Number" MessageValidatorTip="True" ErrorTooltipEnabled="True" CultureName="en-US" /> <ajaxToolkit:MaskedEditValidator ID="editValidatorSSN" runat="server" ControlExtender="editExtSSN" ControlToValidate="txtInsSSN" ValidationExpression="\d{3}-\d{2}-\d{4}" InvalidValueMessage="Entry is invalid" IsValidEmpty="True" InvalidValueBlurredMessage="*" ValidationGroup="valSSN" Display="Dynamic" /> <asp:TextBox ID="txtInsSSN" runat="server" Width="160px" Font-Size="10px" ValidationGroup="SSN" />  As you can see, I'm simply trying to allow only numbers to be entered in the textbos and validate for an SSN in the format ###-##-####. I've tried everything I can think of and my own social security number won't even validate! I'd really appreciate it if someone can tell me what I'm doing wrong/missing!

MaskedEditExtender looses format when not in focus


I have a tex box which I'm using to capture a bank sort code.

I want to use the AJAX MaskedEditExtender so the user only ever inputs the data in this format 12-34-56.

Here is my extender code:

<asp:MaskedEditExtender ID="mexSortCode" runat="server" TargetControlID="txtSortCode"
                                    Mask="99-99-99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                                    OnInvalidCssClass="MaskedEditError" InputDirection="LeftToRight"
                                    AcceptNegative="Left" ErrorTooltipEnabled="True" />

This initially works fine, however when i remove the focus on this text box the input removes any hyphen and the texbox value is left like this 123456.

Does anyone know a way which i can maintain the input?

Many thanks

Ajax MaskedEditExtender mask not working properly after turning off readonly



I ran into a strange issue with the AJAX MaskedEditExtender control, the extender is used with the Mask="99/99/9999" and MaskType="Date". Initially when the page loads the textbox was set to readonly using textbox.Attributes.Add("readonly", "readonly") in the codebehind. After the page loads if the user clicks on a certain button it would change the textbox to editable using javascript code: textbox.readOnly = false. The strange thing is after that if you start typing in the textbox you can see the entire mask (__/__/____) shifting to the right as you type. For example it looks something like this: 09__/__/____ instead of the normal 09/__/____.

If the textbox was never set to readonly in the first place this behavior won't happen. So it seems something got messed up when changing from readonly to not. I was able to reproduce this in a barebone aspx page with just the textbox, the mask extender, and a button that when clicked turning off the textbox's readonly. Anyone knows how I can fix this?

I'm using Ajax toolkit v3.0.30512


Default MaskedEditExtender and MaskedEditValidator CSS Class Location


I am new to using the MaskedEditExtender and MaskedEditValidator controls. When I went to set these up, I found that it entered the CSS class names automatically for the following properties.

OnBlurCssNegative = MaskedEditBlurNegative
OnFocusCssClass = MaskedEditFocus
OnFocusCssNegative = MaskedEditFocusNegative
OnFocusCssClass = MaskedEditError

However, I do not have these CSS classes in my Styles.css file. Where are these CSS classes located? Also, if I do include these same classes in my own stylesheet, will it override whatever the classes state in this default location or do I have to call them something different?

Using a for email



      I need to use a Maskededitextender for email text box instead of the usual RegularExpressionValidator. I am not sure how to set the mask property for the control. Please help.



Insert Ignored When Time Field Populated (MaskedEditExtender & MaskedEditValidator)


I have a C#/ASP.NET web application that utilizes the Entity Framework and pages with DetailsView controls that provide CRUD operations through EntityDataSource objects. The fields in the DetailsView control are template fields with various standard ASP.NET web controls. I have a table that contains various fields with different data types, including time(7). However, the controls for the time fields also have the AJAX MaskedEditExtender and MaskedEditValidator controls attached to them.

Everything works great, until a record is inserted where a value is specified for a time field. When that happens, it acts like it's inserting, posts back, executes statements, etc. but no record is inserted. No statement is sent to SQL (as seen by a SQL trace), no exception is thrown, nothing... it acts as if everything went perfectly, it just doesn't insert the record.

Since no exception is thrown and the code being executed is inside the EF, I'm kind of at a loss as to where to track this down. I have "Enable .NET Framework Source Stepping" enabled, but it doesn't step into the EF code. Can someone help?

MaskedEditExtender date format incorrect



I have a textbox for date input and I used a MaskedEditExtender to set the Mask="99/99/9999": here is the code:

<asp:TextBox runat="server" ID="tbDate" Width="80px" />

<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="tbDate" Mask="99/99/9999" MaskType="Date" />

In my code when the page loads I need to set the tbDate to readonly, then when the user enters some other info on the page I will make tbDate editable (not readonly), I did all these using javascript by setting tbDate.readOnly = true/false. However, when going from readonly to editable, when the tbDate field receives the focus, the mask __/__/____ appears, but when the user starts typing the first digit, it pushes the mask as if the mask was part of the value, so it becomes something like 12__/__/____ instead of 12/__/____. If I commented out the code that makes the tbDate field readonly, then the mask works as expected. Any idea?

Thank you.

Strange results with MaskedEditExtender


I've inherited a web project from another company, and I'm having a weird issue with a phone number mask.

If the ClearMaskOnLostFocus is "true", I lose the mask in the edit field (this is a editing screen for an existing

record). If set to false, the mask is present, but the leading digit is truncated, and will write back to the DB

an incorrect number if submitted, with that leading "_".

True = 8885551212


The DB field a a varchar(20) -- don't ask me why.

<asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server"
                                            ClearMaskOnLostFocus="true" MaskType="Number"
                                            Enabled="True" Mask="(999) 999-9999"

Highlight contents of textbox with MaskedEditExtender



I have looked all over the place and I haven't found a solution to this. I have a TextBox using the AjaxControlToolkit's MaskedEditExtender, the extender is using the Date mask (99/99/9999). We had modified the toolkit code to support 2-digit year (as seen in this post) which works just fine when the date TextBox initially has no value. But when the date TextBox has an existing date such as 10/04/2010, if I type in say 100409, it becomes 10/04/0910, in other words it doesn't replace the existing year but simply replace the first 2 digits of the year. If I first hightlight the entire field then type then it works. My question is is there a way to hightlight the entire date value of the TextBox upon entering the field? I tried using javascript code textbox.focus() and .selet() but it doesn't highlight anything, it just places the cursor at the beginning of the textbox. Or is there another solution to what I need to achieve?

Thank you.

How to Configure MaskedEditExtender & MaskedEditValidator



I have a C#/ASP.NET web application that contains DetailsView controls that are used for CRUD operations through the EntityDataSource and Entity Framework. Unfortunately I'm not sure which forum would be best to post this under, since I am wondering whether either the MaskedEdit AJAX controls or Entity Data Model could be configured to allow for this.


The Entity Framework requires time fields to be of time(7) data type, which must be entered as 24-hour time, with seconds (e.g. '09:30:00'). However, I want the time entered in 12-hour time and without seconds (e.g. '9:30 AM'). Is there a way I can configure the MaskedEditExtender and/or MaskedEditValidator to allow for this. What I was thinking is possibly using the AutoComplete portion of this control to fill in the remaining portions (i.e. seconds) that the user does not enter, but which the EF requires. Either that or can the Entity Data Model or something else be configured to allow for this?

Existing Code

<asp:TemplateField HeaderText="Start Time" SortExpression="StartTime">

MaskedEditExtender forcing user to enter decimal point...


I have a MaskedEditExtender set for a TextBox that will receive a fee amount. I want the user to be able to type the "." decimal when the amount contains a decimal value (123.45). But if the amount has not decimals (123) I want the mask to automatically fill the 2 decimal with zeroes and also enter the "." decimal point (123.00).

With the following mask I'm able to enter a full number (999) and get the zeroes but when user enters 85.85 it will be 850.85 so I change the direction RightToLeft but I'm not even able to type the first character.

<cc1:MaskedEditExtender ID="txtFee1ME" runat="server" PromptCharacter=" " Mask="999.99" 
                    Enabled="True" TargetControlID="txtFee1" MaskType="Number">


problem with MaskedEditExtender using datetime


Hi, i am using an maskededitextender, heres the code:

<cc1:MaskedEditExtender ID="MaskedEditExtender2" runat="server" Mask="99/99/9999 99:99"

MaskedEditExtender, text removed if you lose focus and set focus back on textbox


I have a MaskedEditExtender with Mask="(999) 999-9999".

Now my problem is, if someone goes into the textbox and enters


Then they leave the textbox, and then see that they forgot to enter the area code, if they go back in there to enter the area code, it starts overwritting the other numbers instead of just adding to them. 

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend