Hi folks, i have this cms:QueryDataList on my page.
<cms:QueryDataList runat="server" ID="lstItems1" QueryName="custom.PageType.GET_FAVORITES" TransformationName="custom.PageType.RecetasFavoritas" RepeatDirection="Horizontal" RepeatLayout="Flow" CacheMinutes="0" WhereCondition="RF.FbId = '518734966'"></cms:QueryDataList>
and works perfectly, but it need to be dynamic so i tried the next code changing the wherecondition
if (client != null) { lstItems1.WhereCondition = "RF.FbId = '" + client.id + "'"; %> <cms:QueryDataList runat="server" ID="lstItems1" QueryName="custom.PageType.GET_FAVORITES" TransformationName="custom.PageType.RecetasFavoritas" RepeatDirection="Horizontal" RepeatLayout="Flow" CacheMinutes="0"></cms:QueryDataList> <% } %>
but thats show me all registers in the database, like if i remove the whole condition there. and of course, this other code didn't work at all.
<cms:QueryDataList runat="server" ID="lstItems1" QueryName="custom.PageType.GET_FAVORITES" TransformationName="custom.PageType.RecetasFavoritas" RepeatDirection="Horizontal" RepeatLayout="Flow" CacheMinutes="0" WhereCondition="RF.FbId = '<%client.id%>'"></cms:QueryDataList>
how can i solve this??
You need to bind it similar to a nested repeater if you're doing this in a transformation. See this question and the answer(s) I've posted.
thanks !
thats the correct answer! i only had to do this.
<script runat="server"> protected override void OnInit(EventArgs e) { if (client != null) { lstItems1.WhereCondition = "RF.FbId = '" + client.id + "'"; } } </script>
Please, sign in to be able to submit a new answer.