Copied to clipboard

Flag this post as spam?

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


  • Evan Harper 15 posts 37 karma points
    Nov 13, 2012 @ 18:06
    Evan Harper
    0

    Explicitly named fields for POSTing from elsewhere

    Hello Umbraconauts,

    see also: defining an id on input fields

    I would like to build some forms that can be submitted manually through the normal process, but also can be posted to "behind the scenes" from JavaScript found on another page. Trouble is that the editor controls generated by Contour have names generated by ASP.NET à la "ctl00$ctl00$ctl00$ctl00$ctl00$ctl00$ContentPlaceHolderDefault$pageMainContent$pageMainContent$pageMainContent$ctl00$RenderForm_8$rpFieldsets$ctl00$rpFields$ctl00$f177d7e4_43ac_47bb_8a7d_e2f6f84f38be", which can't be trusted to remain constant. So I can't just hard-code those names into my external JavaScript.

    The only way that ocurred to me to get around this was to manually create field types like ExplicitlyNamedTextField, ExplicitlyNamedCheckBoxList, etc, each one of which would explicitly set it's editor control's ClientID. But this would involve a lot of repetitive work and would have to be manually repeated every time a different field type needs to be created.

    Can anyone think of a better way to do this?

    Evan Harper

  • Evan Harper 15 posts 37 karma points
    Nov 13, 2012 @ 21:22
    Evan Harper
    1

    D'oh... it looks like I made the cardinal error of getting into custom implementation work without looking for the "lazy way" first... Cultiv RestContour appears to be exactly what I was looking for.

Please Sign in or register to post replies

Write your reply to:

Draft