GridView with DropDownList – Server tag is not well formed.

Ran across an issue today when trying to get my DropDownList embedded within a GridView.   Here is an extract of the code (the error is in the red text):

<ItemTemplate>
  <asp:DropDownList
        ID="ddlMaker"
        runat="server"
        DataSourceID="odsMakers"
        DataTextField="makerName"
        SelectedValue="<%#Bind("MakerID") %>"
        DataValueField="makerID">
  </asp:DropDownList>
</ItemTemplate>

When I compiled I received an error “The server tag is not well formed.”

After a bit of trial and error I realized it was because there were quotes nested within quotes. To make this work all that had to be done was to change the outside double quotes on the SelectedValue parameter to be single quotes as shown below.

<ItemTemplate>
  <asp:DropDownList
        ID="ddlMaker"
        runat="server"
        DataSourceID="odsMakers"
        DataTextField="makerName"
        SelectedValue='<%#Bind("MakerID") %>'
        DataValueField="makerID">
  </asp:DropDownList>
</ItemTemplate>

Hope I saved someone a bunch of wasted time.