This has to be an easy one...what am I doing wrong?
I have a custom module, that I want to filter by the URL
example URL: http://www.somesite.com/partners/north-america/FilterString
I have a usercontrol that loads on the page, I grab the filterstring from the URL:
var myPartner = string.Empty;
var param = Request.RequestContext.RouteData.Values["params"] as string;
myPartner = (string)param;
Now I want to pull my "Partners" which is my custom module and filter by the filter string above.
This is my query:
var PartnersCollection = dynamicModuleManager.GetDataItems(partnerType).Where(p => p.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && p.UrlName == myPartner &&
>("Active") == true);
If I pull out "p.UrlName == myPartner" the query works fine and pulls all Partners. I just want to filter by the auto generated URL that was created when the Partner was created.
I tried these already:
p.UrlName == myPartner
p.SystemUrl == myPartner
p.Urls.Url == myPartner
The first one pulls 0 records and the last 2 cause errors. What am I doing wrong?