I've created a web part that I'm going to use as a widget that has 4 fields that content users can input info in. What I want to do is use those values in the query repeater to modify the number of records returned as well as modify the where condition.
In my code behind, I've created the public properties and I have access to it in the ascx front end file via normal C# server side scripting, however I can't inject them into the TopN and WhereCondition attribute.
For example, this doesn't work:
<cms:QueryRepeater ID="RptTest" runat="server" QueryName="Custom.TestPageType.QueryName" TransformationName="Custom.TestPageType.TransformationName" WhereCondition="Published = {%WebPartField %}"></cms:QueryRepeater>
I know I can use {%CurrentDocument["DocumentField"]#%} to get the current document. Is there an equivalent for web parts?
Thanks!
Set them in code behind like so:
RptTest.TopN = TopN;
Don't set them on the front ascx side.
Brilliant. Just what I needed. Thanks!
Please, sign in to be able to submit a new answer.