maybe a bug in Sys.BindingBase.Transformers.ToString

Last post 06-17-2006 7:59 AM by Garbin. 1 replies.

Sort Posts:

  • maybe a bug in Sys.BindingBase.Transformers.ToString

    06-16-2006, 9:58 PM
    • Member
      40 point Member
    • needsoft
    • Member since 11-23-2005, 2:59 AM
    • china
    • Posts 9

    When I bind a Date value to a Label's text property, I use ToString Transformers with a format stirng "{0:d}", but it doesn't work.

    So I search the code in atlas.js and find the definition of Sys.BindingBase.Transformers.ToString, I got this in line 7:

        var placeHolder = (formatString && (formatString.length != 0)) ? formatString.indexOf('{0}') : -1;

    maybe it's why it's doesn't work, so I change it to :

        var placeHolder = (formatString && (formatString.length != 0)) ? formatString.indexOf('{0') : -1;

    Then, it works. But I haven't test more to affirm this change is right

  • Re: maybe a bug in Sys.BindingBase.Transformers.ToString

    06-17-2006, 7:59 AM
    • Contributor
      7,416 point Contributor
    • Garbin
    • Member since 09-17-2004, 8:35 AM
    • Sassari, Italy
    • Posts 1,506
    • ASPInsiders
      TrustedFriends-MVPs
    Hi,

    the ToString() transformer supports a single {0} placeholder. You have to write your own transformer to handle other cases.
    Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action
Page 1 of 1 (2 items)