title: Dynamically set the DefaultValue of a ParameterBinding in a DataFormWebPart
body: <p>In my custom aspx page in WSS I am using a DataFormWebPart with an xsl file to render some data. In order to pass values to the xsl I use parameter bindings. Specifically, I need to pass in the server host url like this:</p>
  
  <pre><code>&lt;ParameterBinding 
      Name="HttpHost" 
      Location="CAMLVariable" 
      DefaultValue="http://hardcoded.com" /&gt;
  </code></pre>
  
  <p>This works fine, but the next thing I want to do is to get the host name dynamically. So figuring out how to get that from SharePoint I added the following binding:</p>
  
  <pre><code>&lt;ParameterBinding 
      Name="HttpHost" 
      Location="CAMLVariable" 
      DefaultValue='&lt;%# SPContext.Current.Site.Url.Replace
         (SPContext.Current.Site.ServerRelativeUrl, "") %&gt;' /&gt;
  </code></pre>
  
  <p>Now to the problem. The code works as expected if used some other place in the page, but with the above code SharePoint reports: </p>
  
  <blockquote>
    <p>Web Part Error: The 'ParameterBindings' property of 'WebPartPages:DataFormWebPart'
    does not allow child objects. </p>
  </blockquote>
  
  <p>Anyone have a take on this? </p>
  
  <p>Update: I have enabled server side code according to <a href="http://weblogs.asp.net/soever/archive/2006/07/27/SharePoint-2007_3A00_-using-ASP.NET-server-side-code-in-your-pages.aspx" rel="noreferrer">this article</a></p>