I want to put some code at the top of my page template that looks like this:
string curNode = CMS.CMSHelper.CMSContext.CurrentPageInfo.NodeID;
string where = "";
switch (curNode){
case "[NodeID1]":
where = "Region = 1";
break;
case "[NodeID2]":
where = "Region = 2";
break;
case "[NodeID3]":
where = "Region = 3";
break;
case "[NodeID4]":
where = "Region = 4";
break;
}
this.QueryDataSource.WhereCondition = where;
this.QueryDataSource.ReloadData(true);
I have 4 pages that use the same template which populates a uniview based on a custom query. Since they share the template I need to dynamically set the where condition as shown above. When I put that at the top of my template I get the following error.
does not contain a definition for 'QueryDataSource' and no extension method 'QueryDataSource'
Seems like I am missing a reference, can someone help with he syntax?
Thanks