Querying for Page by Name
I'm a bit perflexed as to how to use the fluent api. I have a custom control and I want to bind a hyperlink to a specific page.
protected override void InitializeControls(Telerik.Sitefinity.Web.UI.GenericContainer container)
HyperLink homelnk = this.Container.GetControl<
HyperLink
>("home", true);
var homePage = App.WorkWith().Pages().Where(p => p.Page.Title == "Home").Get().FirstOrDefault();
homelnk.NavigateUrl = homePage.GetUrl();
homelnk.Text = homePage.Page.HtmlTitle;
Hi Dallas Beek,
You need to modify the query for getting the PageNode:
var homePage = App.WorkWith().Pages().Where(p => p.Title ==
"Home"
).Get().FirstOrDefault();
if
(homePage !=
null
)
...