Solved

Why does the decimal place get shifted when using an ASP.NET MaskedEditExtender?

Posted on 2008-06-24
1
1,089 Views
Last Modified: 2012-08-13
I have a textbox that accepts a monetary rate on an ASP.NET page.  The rate is fetched from a database and populated in the textbox.  Everything works correctly until I add an ASP.NET AJAX MaskedEditExtender to the textbox.  With that in place, the decimal place of the incoming rate (from the database) is shifted 2 decimal places to the right, i.e. $10 is shown as $1000.  Has anyone encountered this problem?
<asp:TextBox 
ID="TextBoxRate" 
runat="server" 
Text='<%# Bind("Rate") %>'>
</asp:TextBox>
<cc1:MaskedEditExtender 
ID="MaskedEditExtenderRate" 
runat="server" 
DisplayMoney="Left" 
InputDirection="RightToLeft" 
Mask="999,999,999.99" 
MaskType="Number" 
TargetControlID="TextBoxRate">
</cc1:MaskedEditExtender>

Open in new window

0
Comment
Question by:pureauto
1 Comment
 

Accepted Solution

by:
pureauto earned 0 total points
ID: 21870777
If you format the money column ('rate' in my case) to Decimal(18, 2) in SQL it will work correctly with the MaskedEditExtender.
CAST(Rate AS DECIMAL(18, 2)) as Rate

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

809 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