System.FormatException:

22 posts, 0 answers
  1. Jagat
    Jagat avatar
    135 posts
    Member since:
    Jan 2011

    Posted 25 Nov 2014 Link to this post

    We started getting this error message on all the pages that uses RadListBox. But only few clients are getting this issue. This is definitely not the data issue since all the users would be getting the error.

    We are using  version 2011.3.1305.35 Telerik Ajax Controls.

    System.Exception: 337.7143 is not a valid value for
    Int32. ---> System.FormatException: Input string was not in a correct
    format.

       at
    System.Number.StringToNumber(String str, NumberStyles options,
    NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

       at
    System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

       at
    System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo
    formatInfo)

       at
    System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext
    context, CultureInfo culture, Object value)

       --- End of inner
    exception stack trace ---

       at
    System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext
    context, CultureInfo culture, Object value)

       at
    System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)

       at
    System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object
    o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
    Object& convertedObject)

       at
    System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object
    o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
    Object& convertedObject)

       at
    System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object
    propertyValue, Object o, String memberName, JavaScriptSerializer serializer,
    Boolean throwOnError)

       at
    System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2
    dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
    Object& convertedObject)

       at
    System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object
    o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
    Object& convertedObject)

       at
    System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object
    o, Type type, JavaScriptSerializer serializer, Boolean throwOnError,
    Object& convertedObject)

       at
    System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer
    serializer, String input, Type type, Int32 depthLimit)

       at
    System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String
    input)

       at
    Telerik.Web.UI.RadListBox.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)

       --- End of inner
    exception stack trace ---

       at
    System.Web.UI.Page.HandleError(Exception e)

       at
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint)

       at
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
    Boolean includeStagesAfterAsyncPoint)

       at System.Web.UI.Page.ProcessRequest()

       at
    System.Web.UI.Page.ProcessRequest(HttpContext context)

       at
    ASP.frm_clientservices_aspx.ProcessRequest(HttpContext context)

       at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously).  
  2. Mehmet
    Mehmet avatar
    7 posts
    Member since:
    Jun 2009

    Posted 25 Nov 2014 Link to this post

    We have also started receiving the same error message for a couple clients. It's almost impossible to debug, because I can't reproduce the error myself. Most of them are Chrome users, and I think there might be some problem related to Chrome's recent updates, but I'm not sure. Any help will be greatly appreciated
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 26 Nov 2014 Link to this post

    Hi,

    We are aware of the problem and we are working on it. Here is the public item:
    http://feedback.telerik.com/Project/108/Feedback/Details/144661-fix-treeview-throws-system-formatexception-input-string-was-not-in-a-correct-f

    EDIT:

    Same error can be thrown if you are using RadScheduler, RadListBox, RadTreeView.

    Error appears only on Google Chrome when the page is zoomed in/out.
    Temporary workaround: Change the Zoom to 100%.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. rei
    rei avatar
    12 posts
    Member since:
    Jul 2009

    Posted 30 Nov 2014 Link to this post

    Hi ,

    We're also  encountering the same problem with some of our clients but it's hard to fix since I cannot replicate the problem myself.
    Below is the exception in our logs.


    Exception information:
        Exception type: Exception
        Exception message: 401.6 is not a valid value for Int32.
       at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
       at System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)
       at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
       at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
       at System.Web.Script.Serialization.ObjectConverter.AssignToPropertyOrField(Object propertyValue, Object o, String memberName, JavaScriptSerializer serializer, Boolean throwOnError)
       at System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary`2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
       at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
       at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
       at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
       at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)
       at Telerik.Web.UI.RadListBox.LoadPostData(String postDataKey, NameValueCollection postCollection)
       at Telerik.Web.UI.RadDataBoundControl.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)

    Input string was not in a correct format.
       at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
       at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
       at System.ComponentModel.Int32Converter.FromString(String value, NumberFormatInfo formatInfo)
       at System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)






















  6. Robert
    Robert avatar
    20 posts
    Member since:
    Sep 2010

    Posted 01 Dec 2014 in reply to rei Link to this post

    Same here!

    Getting more reports of this now and doesn't seem to be ANYTHING I can do about it!

    Can't reproduce it, can't debug it, can't workaround it. Zooming in/out doesn't make any difference.

    Please can you post a workaround or at least explain (technically) what's going on here?


  7. Robert
    Robert avatar
    20 posts
    Member since:
    Sep 2010

    Posted 01 Dec 2014 Link to this post

    Figured out what's going on by looking at the postback logs.

    Chrome has started setting the scroll position as a floating point rather than an integer. RadListBox is not flooring this value before posting it back (or just parsing it as a double) which is causing a parsing exception on the server.

    E.g. here's an example ClientState hidden field value after scrolling:

    {"isEnabled":true,"logEntries":[{"Type":5,"Index":"12","Data":{"NewIndex":"17"}},{"Type":5,"Index":"18","Data":{"NewIndex":"9"}}],"selectedIndices":[],"checkedIndices":[12,18],"scrollPosition":36.6667}

    That 36.6667 is the problem. I've worked around it by handling the RadListBox scroll event and flooring out the value before it's posted back:

    $(".RadListBoxScrollable .rlbGroup").off("scroll.position-fix").on("scroll.position-fix", function () {

        $(this).scrollTop(Math.floor($(this).scrollTop()));
    });

    I should stress I'm not 100% if this will fix it yet, I'm awaiting user feedback as I can't reproduce it myself! But I'm pretty sure it will fix the problem as the issue is clearly that the RadListBox attempts to do an int.Parse() on a floating point on postback.
  8. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 01 Dec 2014 Link to this post

    Hi,

    Here are the workarounds for:

    RadScheduler:
    <script type="text/javascript">
        Telerik.Web.UI.RadScheduler.prototype.saveClientState = function () {
            return '{"scrollTop":' + Math.round(this._scrollTop) + ',"scrollLeft":' + Math.round(this._scrollLeft) + ',"isDirty":' + this._isDirty + '}';
        }
    </script>


    RadTreeView:
    <script type="text/javascript">
        Telerik.Web.UI.RadTreeView.prototype.saveClientState = function () {
            return "{\"expandedNodes\":" + this._expandedNodesJson +
            ",\"collapsedNodes\":" + this._collapsedNodesJson +
            ",\"logEntries\":" + this._logEntriesJson +
            ",\"selectedNodes\":" + this._selectedNodesJson +
            ",\"checkedNodes\":" + this._checkedNodesJson +
            ",\"scrollPosition\":" + Math.round(this._scrollPosition) + "}";
        }
    </script>

    RadListBox:
    <script type="text/javascript">
            Telerik.Web.UI.RadListBox.prototype.saveClientState = function() {
                return "{" +
                            "\"isEnabled\":" + this._enabled +
                            ",\"logEntries\":" + this._logEntriesJson +
                           ",\"selectedIndices\":" + this._selectedIndicesJson +
                           ",\"checkedIndices\":" + this._checkedIndicesJson +
                           ",\"scrollPosition\":" + Math.round(this._scrollPosition) +
                       "}";
            }
    </script>      

    The fix for the issue will be included in the upcoming Service Pack.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Rachel
    Rachel avatar
    3 posts
    Member since:
    Sep 2014

    Posted 04 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    Are you able to provide a javascript workaround for the RadDropDownList as well? Many thanks.
  10. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 05 Dec 2014 Link to this post

    Hi Rachel,

    This problem shouldn't exist in the RadDropDownList? If you receive error message please open new thread here: http://www.telerik.com/forums/aspnet-ajax/dropdownlist and describe the problem in details.

    Thanks.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. Rachel
    Rachel avatar
    3 posts
    Member since:
    Sep 2014

    Posted 05 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    I'm not having a problem with it, but in your post dated 26 Nov you said:

    'Same error can be thrown if you are using RadScheduler, RadListBox, RadDropDownList, RadTreeView.'

    So I was going from that.
  12. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 08 Dec 2014 Link to this post

    Sorry Rachel,

    This was a mistake. I edited my post. Fix for the other issues will be included in Q3 2014 SP1. It is expected to be released till the end of week.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  13. SHERFUDEEN
    SHERFUDEEN  avatar
    21 posts
    Member since:
    Apr 2011

    Posted 09 Dec 2014 Link to this post

    Hi Hristo Valyavicharski,
    I am also getting the same issue. I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

    I changed the code as

    $(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
    // code
    }
    Now I am getting
    " Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
    How can I solve this?
  14. Mark
    Mark avatar
    79 posts
    Member since:
    Apr 2007

    Posted 09 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    Is there an ETA on the release of Q3 2014 SP1?  Is the fix available in the nightly build?
  15. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 10 Dec 2014 Link to this post

    Q3 SP1 2014.3.1209 was released yesterday. You can download it from our website.

    Regards,
    Hristo Valyavicharski
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  16. SHERFUDEEN
    SHERFUDEEN  avatar
    21 posts
    Member since:
    Apr 2011

    Posted 10 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    Hi Hristo Valyavicharski,

    Is there any solution for my below issue without updating the Telerik Q3. I am using 2014.1.225.40 version


    " I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

    I changed the code as

    $(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
    // code
    }
    Now I am getting
    " Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
    How can I solve this? "

    "
  17. SHERFUDEEN
    SHERFUDEEN  avatar
    21 posts
    Member since:
    Apr 2011

    Posted 10 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    Hi Hristo Valyavicharski,

    Is there any solution for my below issue without updating Telerik Q3. I am using 2014.1.225.40 Version

    " I added the Javascript in the Masterpage of my application. But I am getting the error "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

    I changed the code as

    $(Telerik.Web.UI.RadListBox).prototype.saveClientState =funtion(){
    // code
    }
    Now I am getting
    " Uncaught TypeError: Cannot set property 'saveClientState' of undefined (anonymous function)" Error
    How can I solve this? "

  18. John
    John avatar
    3 posts
    Member since:
    Feb 2012

    Posted 12 Dec 2014 in reply to SHERFUDEEN Link to this post

    I am experiencing the same issue, "Uncaught TypeError: Cannot read property 'prototype' of undefined" when trying to apply the fix for Treeview. Is there a fix for this?
  19. John
    John avatar
    3 posts
    Member since:
    Feb 2012

    Posted 12 Dec 2014 in reply to Hristo Valyavicharski Link to this post

    Hristo, I am experiencing the same issue as Sherfudeen when applying the fix for Treeview  "Uncaught TypeError: Cannot read property 'prototype' of undefined ".

    What can I do the resolve this?
  20. Rachel
    Rachel avatar
    3 posts
    Member since:
    Sep 2014

    Posted 12 Dec 2014 Link to this post

    When putting the fix in the master page, what worked for me was to wrap each fix like this:

    if (Telerik.Web.UI.RadTreeView != undefined) {
                [RadTreeView fix goes here]
            }

    When including the fix in the master page, there might not be an instance of that control on a particular page, so it will throw an error on that page unless you add this condition to the fix. At least I think that's what the problem is anyway :)

    Hope that helps!
  21. Jagat
    Jagat avatar
    135 posts
    Member since:
    Jan 2011

    Posted 12 Dec 2014 in reply to Rachel Link to this post

    Hristo,
    With this update Q3 SP1 2014.3.1209, i am having issues on radgrid. 
    System.InvalidCastException: Conversion from string
    "&nbsp;" to type 'Integer' is not valid. --->
    System.FormatException: One of the identified items was in an invalid format.

    Another error we found:
    System.InvalidOperationException: Telerik.Web.UI.RadGrid
    with ID='RadGrid1' was unable to find an embedded skin with the name 'Hay'.
    Please, make sure that the skin name is spelled correctly and that you have
    added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If
    you want to use a custom skin, set EnableEmbeddedSkins=false.

    Nothing else was changed in code. 
    Just, update the dll's and we get these errors.






  22. SHERFUDEEN
    SHERFUDEEN  avatar
    21 posts
    Member since:
    Apr 2011

    Posted 15 Dec 2014 in reply to Rachel Link to this post

    Thanks for the solution Rachel, it works.
  23. John
    John avatar
    3 posts
    Member since:
    Feb 2012

    Posted 15 Dec 2014 in reply to Rachel Link to this post

    @Rachel, thanks this solved my issue.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017