InputManager, setting asp textbox to Numeric contains commas server/side

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    29 posts
    Member since:
    May 2011

    Posted 06 Apr 2012 Link to this post

     In rare cases, the value in an asp.TextBox validated by the RadinputManager as a Numeric Field, is showing commas on the Server Side...

    On My Master Page I have:

    <telerik:RadInputManager ID="SharedInputManager" runat="server">
                 <telerik:NumericTextBoxSetting DecimalDigits="0" BehaviorID="NoCSSNumber" InitializeOnClient="false" ReadOnlyCssClass="ReadOnlyStyleInputManager" Validation-ValidateOnEvent="Blur">
    <telerik:NumericTextBoxSetting DecimalDigits="0" BehaviorID="Number" InitializeOnClient="false" ReadOnlyCssClass="RIM_ReadOnly" EnabledCssClass="RIM_Width" FocusedCssClass="RIM_Width" HoveredCssClass="RIM_Width" InvalidCssClass="RIM_Width" Validation-ValidateOnEvent="Blur">

    //CSS is in external css file




    background-color:#DEDEDE !important;




    border-style:groove !important;




    width:196px !important;







    width:196px !important;



    Then in the code-behind I set:

    ((NumericTextBoxSetting)SharedInputManager.GetSettingByBehaviorID("NoCSSNumber")).TargetControls.Add(new TargetInput(tbMyTextBox.UniqueID, true)); 
    ((NumericTextBoxSetting)SharedInputManager.GetSettingByBehaviorID("Number")).TargetControls.Add(new TargetInput(tbMyTextBox2.UniqueID, true));

    Now, in rare cases, and only when i use the "NoCSSNumber" the textbox value server side will contain commas.
    Example, on the user side, the text for tbMyTextBox is 1,000 and the text for tbMyTextBox2 is 1,000.
    Then on the server side sometimes tbMyTextBox.Text is "1,000", but most of the time it is "1000". tbMyTextBox2 is ALWAYS "1000"

    Why the discrepancy? What is the expected behavior? I expect it to always be "1000" on server side. And for most of my users the server-side value is 1000, but everyonce in a while it will make it to the server as 1,000 and throw an error...

    Any help is appreciated.


  2. Andrey
    Andrey avatar
    836 posts

    Posted 12 Apr 2012 Link to this post


    Before we could qualify some issue as a bug we need to reproduce the issue locally and investigate the causes. Since the issue is not always reproducible and we have not reproduced it locally, we could not  count it as a bug.

    However, possible cause for this behavior could be a JavaScript error which is not always encountered. If JS error is thrown RadInputManager won't be able to change the input value in accordance with the specified format.

    You could verify the presence/absence of JS errors by enabling the script debugging for the browser you are using and then if an error is thrown send the call stack  to us. Additionally, you could send stripped down version of your project. Thus we will be able to find the source of issue.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top