?
Solved

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

Posted on 2008-06-24
1
Medium Priority
?
1,124 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
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…
Suggested Courses

840 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