本文整理汇总了C#中System.Web.Routing.RequestContext.GetPageRoute方法的典型用法代码示例。如果您正苦于以下问题:C# RequestContext.GetPageRoute方法的具体用法?C# RequestContext.GetPageRoute怎么用?C# RequestContext.GetPageRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Routing.RequestContext
的用法示例。
在下文中一共展示了RequestContext.GetPageRoute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateLayoutModel
public virtual LayoutModel CreateLayoutModel(ContentReference currentContentLink, RequestContext requestContext)
{
if (ContentReference.StartPage.ID == 0)
return null;
var startPage = _contentLoader.Get<StartPage>(ContentReference.StartPage);
return new LayoutModel
{
// MenuTopPages = startPage.MenuTopPageLinks,
SearchPageRouteValues = requestContext.GetPageRoute(startPage.SearchPageLink),
SearchPageLink = startPage.SearchPageLink,
// header
SearchLabel = startPage.SearchLabel,
SearchPlaceholderLabel = startPage.SearchPlaceholderLabel,
LogoAlternativeText = startPage.LogoAlternativeText,
// footer
PhoneNumber = startPage.PhoneNumber,
PhoneNumberLabel = startPage.PhoneNumberLabel,
MailAddress = startPage.MailAddress,
Address = startPage.Address,
CvrNumber = startPage.CvrNumber
};
}
示例2: CreateLayoutModel
public virtual LayoutModel CreateLayoutModel(ContentReference currentContentLink, RequestContext requestContext)
{
var settings = _siteSettingsRepository.Get();
return new LayoutModel
{
Logotype = settings.SiteLogotype,
LogotypeLinkUrl = new MvcHtmlString(_urlResolver.GetUrl(SiteDefinition.Current.StartPage)),
ProductPages = settings.ProductPageLinks,
CompanyInformationPages = settings.CompanyInformationPageLinks,
NewsPages = settings.NewsPageLinks,
CustomerZonePages = settings.CustomerZonePageLinks,
LoggedIn = requestContext.HttpContext.User.Identity.IsAuthenticated,
LoginUrl = new MvcHtmlString(GetLoginUrl(currentContentLink)),
SearchPageRouteValues = requestContext.GetPageRoute(settings.SearchPageLink)
};
}
示例3: CreateLayoutModel
public virtual LayoutModel CreateLayoutModel(ContentReference currentContentLink, RequestContext requestContext)
{
var startPage = _contentLoader.Get<StartPage>(SiteDefinition.Current.StartPage);
//var companyPages = _contentLoader.GetChildren<PageData>(startPage.CompanyInformationPageLink)
// .FilterForDisplay(requirePageTemplate: true)
// .ToList();
//companyPages.Insert(0, _contentLoader.Get<PageData>(startPage.CompanyInformationPageLink));
return new LayoutModel
{
Logotype = startPage.SiteLogotype,
LogotypeLinkUrl = new MvcHtmlString(_urlResolver.GetUrl(SiteDefinition.Current.StartPage)),
ProductPages = startPage.ProductPageLinks,
CompanyInformationPages = startPage.CompanyInformationPageLinks,
NewsPages = startPage.NewsPageLinks,
CustomerZonePages = startPage.CustomerZonePageLinks,
LoggedIn = requestContext.HttpContext.User.Identity.IsAuthenticated,
LoginUrl = new MvcHtmlString(GetLoginUrl(currentContentLink)),
SearchPageRouteValues = requestContext.GetPageRoute(startPage.SearchPageLink)
};
}