title: Is it possible to pass a format string to Bind() from code behind?
body: <ul>
  <li>Webforms, .NET 4.51</li>
  </ul>
  
  <p>Using standard databinding as follows:</p>
  
  <pre><code>&lt;asp:TextBox TabIndex="254" Text='&lt;%# Bind("ClientTwoDateOfBirth", "{0:yyyy-MM-dd}") %&gt;'  ID="txtClientTwoDob" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>Is it possible to call the code behind to get the formatting string dynamically? Something like the following (which does not work):</p>
  
  <pre><code>&lt;asp:TextBox TabIndex="254" Text='&lt;%# Bind("ClientTwoDateOfBirth", "{" + GetFormatStringFromCodeBehind() + "}") %&gt;'  ID="txtClientTwoDob" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>