When SharePoint Designer has its own designs

Recently, a colleague came to me with a simple task and an inscrutable error.  He just wanted to populate a text field with a querystring value.  If you've ever done this in SPD, you know it's fairly simple:  create a parameter, map it to a querystring value, and then use the resulting parameter name in your form field.

Having done so, however, he was told the following by the ASP.NET "yellow barf page":

The 'Text' property of 'asp:TextBox' does not allow child objects.

As it turns out, he had done everything correctly.  The problem was that SharePoint Designer had decided the best place for his FieldDescription control was INSIDE the TextBox control.  Obviously the compiler doesn't know what to do with that.  When the FieldDescription was moved to a less obtrusive location, everything worked as expected.

The moral of the story is, as always, don't trust what any WYSIWYG tool gives you.  If it looks great, then fine.  However, if there's a problem, remember that Design mode was written by human beings who make mistakes... just like the rest of us.

Take THAT, Skynet.

No Comments