Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > Password control causes error for a blank DatePicker in Chrome
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Password control causes error for a blank DatePicker in Chrome

Feed from this thread
  • Kennon McCaa avatar

    Posted on Jul 14, 2010 (permalink)

    First of all, let me say that I have a solution to this and I’m posting just to make you aware of it and to hopefully help someone else.

    My solution was to add the following to my password textbox:

                            AutoCompleteType="Disabled"

    Here is the description of the problem. My page had lots of controls (that’s why I cannot include the whole markup) one was a RadTextBox with TextMode=”Password”, another was a RadDatePicker and finally there was a button that caused a postback.

    The input controls were both blank and readonly.  

    Neither control had any validators attached.

    Upon clicking the button a postback occurred and I got the following error:

    Text property cannot be set. String was not recognized as a valid DateTime.

     

    RangeTextProperty at offset 192 in file:line:column <filename unknown>:0:0

    set_Text at offset 22 in file:line:column <filename unknown>:0:0

    LoadPostData at offset 312 in file:line:column <filename unknown>:0:0

    System.Web.UI.IPostBackDataHandler.LoadPostData at offset 13 in file:line:column <filename unknown>:0:0

    ProcessPostData at offset 346 in file:line:column <filename unknown>:0:0

    ProcessRequestMain at offset 1743 in file:line:column <filename unknown>:0:0

     

    The cause of the problem was Chrome was entering a password in textbox for me (even though it was readonly and explicitly set to be blank).

    When I switched to IE and the password was not entered by the browser the postback worked just fine.

    Once I added

                            AutoCompleteType="Disabled"

    To the RadTextBox the error went away.

    Interestingly, when I was getting the error and I clicked the back button to make the error message go away, if I put the cursor in the RadDatePicker the value NaN/NaN/0NaN would appear in the control.

     

    Hope this helps someone.

  • Dimo Dimo admin's avatar

    Posted on Jul 15, 2010 (permalink)

    Hi Kennon,

    Here is my test page. Are you saying that if you click on the button there is an error in Chome? I can't reproduce such a behavior locally. Tried setting a datepicker value from the popup calendar and without setting - all the same. Are there any particular steps that I should follow? What RadControls version are you using?


    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <script runat="server">
     
    </script>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     
    <head runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
    <telerik:RadTextBox ID="RadTextBox1" runat="server" TextMode="Password" ReadOnly="true" />
     
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" EnableTyping="false" />
     
    <asp:Button ID="Button1" runat="server" Text="Submit" />
     
    </form>
    </body>
    </html>


    Regards,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Kennon McCaa avatar

    Posted on Jul 15, 2010 (permalink)

    I have tried version 2010.1.706.35

    Your sample looks like an accurate representation of the portion of the page that I believe was suffering the problem.

    Our c# code sets the datepicker1.SelectedDate = null on the initial page_load. Perhaps adding that will have an impact.
    Also, we use .ReadOnly = true rather than the EnableTyping=false on the datepicker

    Perhaps making those changes will make the problem happen there.

  • Dimo Dimo admin's avatar

    Posted on Jul 15, 2010 (permalink)

    Hi Kennon,

    Perhaps, but no - the problem is still not reproduced. Please send a demo.

    Regards,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Kennon McCaa avatar

    Posted on Jul 15, 2010 (permalink)

    Sorry but our application is really big and stripping this down will take hours. Hours that I don't have.

    Feel free to mark this as resolved and perhaps if someone else ever experiences it they'll find this post and it will save them a few hours.

    Thanks. k

  • Daniel Williams avatar

    Posted on Sep 28, 2010 (permalink)

    I have run into a similar problem using Firefox 3.5.13 with Telerik.Web.UI 2010.2.826 . Problem does not occur when using IE8.

    Upon RadDatePicker-DateInput getting focus it is automatically populated with "NaN/NaN/0NaN", even though it was blank before.

    Error will occur when Password Textbox control appears after the DatePicker control.  Though oddly enough it works fine when the Password Textbox control appears before the DatePicker control.

    The following code reproduces the error for me using Firefox:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head id="Head1" runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
     
    <form id="form1" runat="server">
     
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
          
        <telerik:RadDatePicker ID="RadDatePicker1" runat="server" />
     
        <telerik:RadTextBox ID="RadTextBox1" runat="server" TextMode="Password" />
     
        <asp:Button ID="Button1" runat="server" Text="Submit" />
      
    </form>
    </body>
    </html>

  • Dimo Dimo admin's avatar

    Posted on Sep 29, 2010 (permalink)

    Hi Daniel,

    I can't reproduce the described problem using the specified RadControls and Firefox versions. Is there a specific sequence of steps that I should follow? Have you tested on different PCs?

    All the best,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Daniel Williams avatar

    Posted on Sep 29, 2010 (permalink)

    I found the trigger for it. 

    Seems to occur when you have firefox save your passwords (password field is automatically populated with a saved password upon visiting a site you've logged into in the past). This combined with the RadDatePicker control appearing before the password textbox control will reproduce the problem.  Seems to be a very specific scenario that causes this. 

    Turning off firefox saving passwords (Tools > Options > Security Tab > Uncheck 'Remember Passwords for sites') resolves the problem.  As well as setting the password texbox AutoCompleteType='Disabled'.

    I can incorporate these workarounds, but just FYI of what I found.  I'm willing to provide any additional support in helping you resolve this.

    Thanks for such a great product!

    -Daniel

  • Dimo Dimo admin's avatar

    Posted on Sep 30, 2010 (permalink)

    Hi Daniel,

    This is what I did with RadControls 2010.2.826.20 and Firefox 3.5.13 by using the test page below:

    1. open page - password textbox and datepicker are both empty
    2. type a password and submit
    3. page reloads - password textbox is prefilled, datepicker is empty
    4. click in the datepicker's dateinput textbox - it remains empty

    the same result was observed after slightly different combinations of actions, so I am afraid I still cannot reproduce the problem. Am I missing something?


    <%@ Page Language="C#" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     
    <head runat="server">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadControls</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" />
      
    <telerik:RadTextBox ID="RadTextBox1" runat="server" TextMode="Password" />
      
    <asp:Button ID="Button1" runat="server" Text="Submit" />
     
    </form>
    </body>
    </html>


    Regards,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  • Pat Gaule avatar

    Posted on Mar 17, 2011 (permalink)

    This bug was happening for us too.  I'm not sure how to determine the version of the RadControls being used, but the "version" property listed under the RadCalendar.Net2 reference is 2.2.5.0.  I know we are using an older version of the controls.  We are running on .NET Framework 2.0, and this bug happened in Firefox 3.6.8 when the "saved password" field was used. 

    We have a RadTabStrip with a couple different tabs.  There is a Calendar control on one of the tab pages, and a password field (a radtextbox) on a "reset password" tab.  The way our site is designed, all of the tabs are loaded when the page is first accessed, even the ones that aren't visible. The first time the page loads, everything works OK.  However, if you click on another tab, it will bomb out with the same error described above:

    Text property cannot be set. String was not recognized as a valid DateTime.
    at Telerik.WebControls.RadDateInput.RangeTextProperty(String value) at Telerik.WebControls.RadDateInput.set_Text(String value) at Telerik.WebControls.DatePickingInput.LoadPostData(String postDataKey, NameValueCollection postCollection) at Telerik.WebControls.RadInputControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    This error only happened in Firefox if a saved password was used.  The only way I could fix this was to disable AutoComplete across the entire site.  Adding AutoCompleteType="Disabled" did not work in our case, because the browser code generated by ASP.NET for that property does not seem to disable autocomplete in Firefox.  I had to go into the masterpage and add the non-standard autocomplete="off" to the HTML <form> tag.

    I'm sure this won't help you troubleshoot the problem, but I wanted you to be aware of it.  Does anyone know if this has been fixed in newer versions of the Rad Controls?

  • Sebastian Sebastian admin's avatar

    Posted on Mar 18, 2011 (permalink)

    Hello Pat,

    Can you please check whether the same issue appears with the AJAX versions of our controls? To migrate to the ASP.NET AJAX counterparts, refer to the individual articles in the documentation which can facilitate the process. Here are those for RadCalendar, RadInput and RadTabStrip:

    http://www.telerik.com/help/aspnet-ajax/calendar-migrating.html
    http://www.telerik.com/help/aspnet-ajax/input-migrating.html
    http://www.telerik.com/help/aspnet-ajax/tabstrip-overview-migrating.html

    Additionally, note that the .NET 2 version of the controls entered their Extended support phase as of Q1 2011, hence it is recommended to upgrade to the .NET 35 or .NET 4 assemblies.

    Kind regards,
    Sebastian
    the Telerik team

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > Password control causes error for a blank DatePicker in Chrome