Solved

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

Posted on 2008-06-24
1
1,106 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

728 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