Problems with RADMaskedTextbox with ViewState Turned Off

6 posts, 1 answers
  1. David
    David avatar
    19 posts
    Member since:
    Nov 2008

    Posted 16 Feb 2010 Link to this post

    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="_"      
    />

     

     

    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.

  2. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 19 Feb 2010 Link to this post

    Hello David,

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    19 posts
    Member since:
    Nov 2008

    Posted 19 Feb 2010 Link to this post

    It turns out that ViewState is irrelevant.

    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.
  5. Answer
    Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 24 Feb 2010 Link to this post

    Hi David,

    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.
  6. Kevin
    Kevin avatar
    2 posts
    Member since:
    Sep 2012

    Posted 01 Feb 2011 Link to this post

    I am using v.2010.3.1317.40 and this is still an issue. When is a fix for this expected?
  7. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 04 Feb 2011 Link to this post

    Hello Kevin,

    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
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017