Solved

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

Posted on 2008-06-24
1
1,098 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
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…

738 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