How to specify WhereCondition in Transformation - Nested Control - kentico 8, 7, 6

Before this i wonder how to pass some where condition in transformation repeater. So i ask the kentico guys and he give me a solution which i think i can share to the others.

So in your transformation you can specify the <script runat="server"></script> element. This is where you can pass the where condition.

Let see the example :

Transformation Code


<cms:queryrepeater id="repItems" ... DelayedLoading="true" ... />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
queryrepeater.WhereCondition= "NodeAliasPath LIKE '"+(string)Eval("NodeAliasPath")+"'";
queryrepeater.ReloadData(true);
}
</script>

Note : queryrepeater dont have DelayedLoading properties, use DataBindByDefault="false" instead.



By
NOTE : – If You have Found this post Helpful, I will appreciate if you can Share it on Facebook, Twitter and Other Social Media Sites. Thanks =)

Popular posts from this blog

Example to disable save as certain file type in SSRS Report Viewer

Phone book application example - Java

Modal Popup Message Box ASP.NEt C# Example