Masked Edit Extender Textbox

Posted on 2009-12-24
Last Modified: 2013-11-26
I have a textbox with an added masked edit extender that populates data.  The mask is set to 99,999 and the mask type is set to number.  Whenever I populate my data, instead of pulling the correct data,  the textbox populates $_0,000 regardless of when the amount should be $5000. I set the mask type to none but now the data pulls as 50,000.  Is there any way in the extender to fix that problem?  Or does it have to be done in the code behind?
Question by:dlavar
    LVL 18

    Expert Comment


    Please post your code, both markup and code-behind.

    LVL 15

    Accepted Solution


     <cc1:MaskedEditExtender ID="MaskedEditExtender1"






    This should work.

    Author Comment

    Sorry I'm just getting back with you guys.  Long weekend.
    But here's the html source code that I have.  I don't have any vb code.

    <cc1:MaskedEditExtender ID="txtAmount_MaskedEditExtender" runat="server" 
                                ClearMaskOnLostFocus="False" ClearTextOnInvalid="True" 
                                CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                CultureThousandsPlaceholder="" CultureTimePlaceholder="" DisplayMoney="Left" 
                                Enabled="True" InputDirection="RightToLeft" Mask="99,999.99" 
                                TargetControlID="txtAmount" PromptCharacter="0">

    Open in new window


    Author Comment

    Rajeeshmca, I'm sorry I wasn't clear.  I need the value to populate with the commas also.  
    For example : $5,000 or 05,000
    LVL 15

    Assisted Solution

    Hi dlavar,

    Try the below one, it works great for me.  

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default4.aspx.vb" Inherits="Default4" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <form runat="server" id="form1">
    <asp:ScriptManager ID="Scr1" runat="server"></asp:ScriptManager>

        <input type="text" id="op" onkeypress="return checkDecimal(event,this);" />
        <asp:TextBox ID="MaskTextBox" runat="server" >
        <cc1:MaskedEditExtender ID="txtAmount_MaskedEditExtender" runat="server"
                                ClearMaskOnLostFocus="False" ClearTextOnInvalid="True"
                                DisplayMoney="Left"  MaskType="Number"
                                Enabled="True" InputDirection="RightToLeft" Mask="99,999.99"
                                TargetControlID="MaskTextBox" PromptCharacter="0">
        <asp:Button ID="SubButton" runat="server" Text="SubButton" />                    

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now