When I use context:If or context:Eval server controls inside my DCP, the Context server controls are not resolved on the web server. However, if I set same DCP as static (setting same CP Template as static), Context server controls are resolved successfully and it works fine.

I'm wondering are we not allowed to use Context server controls inside DCP? Any inputs appreciated!

My understanding is that Context server controls inside DCP makes things looks like server control inside server control and hence it is not resolved on web server.

  • 1
    What is the output format of your dcps ? I think that, if you need any logic inside your dcp's, you should use ascx or rel output format. Commented Nov 12, 2015 at 15:14

1 Answer 1


You have two options:

  1. Publish your DCP to the file system and not to the database so that ASP .NET or your Servlet Container can load it and execute the server side code inside your DCPs including the context: controls
  2. If you are publishing your DCPs to the database and you are using .NET you can use a Virtual Path Provider that will instruct the ASP .NET hosting environment to retrieve and compile DCPs from the database instead of the filesystem. I have it explained in this blog post: Executing DCPs from the Broker Database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.