I have a simple RadMaskedTextBox on a page.
When the page is posted back I want to view the text, and am using the TextWithPromptAndLiterals property and just displaying the contents back to the page. This works fine with all variations of input in the field ie. (12x3.4, _2x3_, 1_x_4)
However when the page that the control is on is modified to turn of the viewstate (enableViewState = “False”), the control no longer works.
Values entered as 12x34 work, however values such as 1_x_4, come back as just “1” (loses the four).
I am using the 2009.3.1314.20 version.
5 Answers, 1 is accepted
The RadMaskedTextBox rely on having the ViewState enabled to perform essential operations. Almost all properties of the control keep their values into the ViewState. So I suggest you to enable the ViewState if you want to get correctly the value from the TextWithPromptAndLiterals property .
Unless the ViewState is not causing any tangible performance problems, you should not be looking for ways to disable it. Additionally, the following post contains additional information on different optimization techniques for the controls suite.
Also we have a lot of optimization techniques for RadControls and I am sure some of them will be of great help for your project. You could find more information in the following forum post:
http://www.telerik.com/community/forums/aspnet-ajax/general-discussions/page-download-size-optimization.aspx
I hope this helps.
Greetings,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I have a simple RadMaskedTextBox on a page:
<telerik:RadMaskedTextBox ID="txt" runat="server" Width="200px" |
Label="Static Mask Question" |
HideOnBlur="true" |
Mask="##x##" |
PromptChar="_" |
/> |
If in the page load method I try to set either the Text or TextWithLiterals to the value ‘1_x_4’, the control loses the last character and only displays ‘1_x__’. The scenario that makes doing this necessary is that I need to be able to capature exactly what was entered in each position of the mask and that it is possible to not enter a value in every position of the mask.
I have debugged into the Telerik code and believe that the problem exists in the SetValue method of the DigitMaskPart. When this method is called, it will only accept a digit thru the regular expression. I believe the regular expression needs to be modified to accept either a digit or the prompt character.
I am using the 2009.3.1314.20 version but have verified the same behavior in the 2008.3.1314.20.
Indeed, I verified that the issue exists in the current version of the controls. We have assigned a higher priority to it and we will do our best to address it in the official Q1 2010 version of RadControls for ASP.NET AJAX .
Best wishes,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Unfortunately the fix for this issue was reverted and into the current version when you set digits mask and try assigning value which does not mach the mask the value is stripped. It seems that this issue is rather complex and it will take some more time to be investigated and if is possible to be fixed. I will forward it again to our development department to be considered further.
Best wishes,
Radoslav
the Telerik team