MaskedEditExtender number only, remove trailing zeros?

爷,独闯天下 提交于 2019-12-25 03:19:28

问题


I have the following ASP.NET code -

<asp:TextBox ID="TextBox1" runat="server" Width="75" />
<ajax:MaskedEditExtender runat="server" TargetControlID="TextBox1" Mask="999999999" MaskType="Number" PromptCharacter=" " />

When I type in "1" and tab out, it displays "100000000". How do I get it to display only "1"? And how do I tweak it so the user can enter any valid positive integers without an upper limit?

Thank you.


回答1:


Duh! I need to use the FilteredTextBoxExtender instead of MaskedEditExtender. Here's the code -

 <ajx:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" Enabled="True"
                    FilterType="Numbers" TargetControlID="TextBox1" />

The whole time I thought I was using the FilteredTextBoxExtender! Oh well.



来源:https://stackoverflow.com/questions/5610442/maskededitextender-number-only-remove-trailing-zeros

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!