Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sl_lipeng 4 posts 24 karma points
    Jan 11, 2010 @ 09:45
    sl_lipeng
    0

    create a datatype

    i try to create a datatype

    there are some code like this:

            public override Guid Id
            {
                get { return System.Guid.NewGuid();}
            }

    it is ok, no error, and can be list in the umbraco backend, but when i choose my datatype, there is a error

    The given key was not present in the dictionary.

    i do not know why, i find this

    http://our.umbraco.org/forum/developers/extending-umbraco/3499-Custom-data-type-issue?sort=newest

    but seems useless for me

     

    can any one help me?

     

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 11, 2010 @ 09:59
    Thomas Höhler
    1

    If you create a new datatype you should use a single, persistent guid like:

    return new Guid("d792a009-ff1e-46ee-bd89-8684f216452d");

    This guid will be saved for the datatype to identify which control to use.

    hth, Thomas

  • skiltz 501 posts 701 karma points
    Jan 11, 2010 @ 10:06
    skiltz
    0

    and the easist way to create a GUID is in Visual Studio is go to Tools -> Create GUID :)

  • sl_lipeng 4 posts 24 karma points
    Jan 11, 2010 @ 10:13
    sl_lipeng
    0

    hi Thomas,

    i change the code to "get { return new Guid("d792a009-ff1e-46ee-bd89-8684f216452d"); }"

    but useless, i know just one key is working, that is 71518B4E-B348-42A1-8662-E7EB18487560

    if i change to other, i will show a yellow page and said "The given key was not present in the dictionary. "

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Jan 11, 2010 @ 10:46
    Hendy Racher
    1

    Hi,

    Am I right in thinking that when creating an empty DataType for the first time via the Developer UI, it's the GUID created in cmsDataType that you then want to hard-code inside the source ?

     

  • sl_lipeng 4 posts 24 karma points
    Jan 11, 2010 @ 10:54
    sl_lipeng
    0

    well, i fixed, I hate junk data

    it is because of junk data

    i create a new site, a new db, and it works

    thanx

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies