Copied to clipboard

Flag this post as spam?

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


  • Ruben Verborgh 379 posts 30 karma points
    May 20, 2010 @ 17:13
    Ruben Verborgh
    0

    Umbraco macro placeholder IDs causing serious problems on postback

    Hi guys,

    At some point in time between 4.0beta and today's 4.0.4 version, Umbraco started to generate placeholder IDs for usercontrol macro's. They start with umbMacro and end with a GUID.

    That means that, a component that used to have the ID

    ctl00_ctl00_ctl00_ContentPlaceHolderDefault_BoostMasterContentPlaceHolder_ctl01_ctl01_Name

    now has the ID

    ctl00_ctl00_ctl00_ContentPlaceHolderDefault_BoostMasterContentPlaceHolder_ctl01_umbMacrod4402495-9c49-4fc0-9868-858dca74decd_Name

    No problem so far.

    However, on postback, the GUID seems to change. This inconsistency causes the ASP.Net postback system to fail.
    As a result, a lot of custom usercontrols do not work anymore.

    Can you check this?

    Ruben

  • Ruben Verborgh 379 posts 30 karma points
    May 20, 2010 @ 22:24
    Ruben Verborgh
    0

    I wonder if this is related to bug #27128... Verifying that right now.

  • Ruben Verborgh 379 posts 30 karma points
    May 20, 2010 @ 22:50
    Ruben Verborgh
    0

    Part of the issue is resolved: Javascript validation is working again, thanks to underscores in the GUID instead of dashes.

    However, the main issue has not been solved: ASP.Net postback is broken because the GUID is different on postback.

    Proposed solutions:

    • Drop the GUID. (but surely you had a good reason to put it in? Maybe the problem of "Control with ID blabla does not exist"?)
    • Do not use a random GUID, but something deterministic. E.g. page X control Y always gets ID X_Y.
  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    May 21, 2010 @ 00:05
    Morten Bock
    0

    Good to hear from you again Ruben

    Would be interesting to hear the background for this change. Seems to be related to caching somehow.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 21, 2010 @ 00:43
    Aaron Powell
    0

    Niels has already said there was a problem and that you shouldn't upgrade to 4.0.4, while he fixes it for (assumeably) 4.0.5

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    May 21, 2010 @ 08:43
    Morten Bock
    0

    I think he only fixed the dashes, and not the fact that the guid changes between postbacks,

  • Ruben Verborgh 379 posts 30 karma points
    May 21, 2010 @ 10:57
    Ruben Verborgh
    0

    I've seen Niels just uploaded a fix to Codeplex. Let's test.

  • Ruben Verborgh 379 posts 30 karma points
    May 21, 2010 @ 10:58
    Ruben Verborgh
    0

    Ok, this should work. The source code removes the ID assignment. Compiling and verifying... (Codeplex is slow!)

  • Ruben Verborgh 379 posts 30 karma points
    May 21, 2010 @ 11:15
    Ruben Verborgh
    0

    It works. Thanks Niels.

    PS Darren got a 303 symphonic music video for his report. I wonder which one I will get ;)

Please Sign in or register to post replies

Write your reply to:

Draft