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:
<ParameterBinding
Name="HttpHost"
Location="CAMLVariable"
DefaultValue="http://hardcoded.com" />
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:
<ParameterBinding
Name="HttpHost"
Location="CAMLVariable"
DefaultValue='<%# SPContext.Current.Site.Url.Replace
(SPContext.Current.Site.ServerRelativeUrl, "") %>' />
Now to the problem. The code works as expected if used some other place in the page, but with the above code SharePoint reports:
Web Part Error: The 'ParameterBindings' property of 'WebPartPages:DataFormWebPart' does not allow child objects.
Anyone have a take on this?
Update: I have enabled server side code according to this article