This is a migrated thread and some comments may be shown as answers.

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

1 Answer 55 Views
Input
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 07 Apr 2012, 02:28 AM
Hi,
 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>
  
<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">
            </telerik:NumericTextBoxSetting>
 </telerik:RadInputManager>

//CSS is in external css file
.RIM_ReadOnly

{

 

 

background-color:#DEDEDE !important;

 

 

 

border-style:groove !important;

 

 

 

width:196px !important;

 

}

.RIM_Width

{

 

 

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.

Thanks

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 12 Apr 2012, 04:09 PM
Hi,

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.

Greetings,
Andrey
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.
Tags
Input
Asked by
Patrick
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or