当前位置: 首页>>代码示例>>C#>>正文


C# RequestContext.GetPageRoute方法代码示例

本文整理汇总了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
            };
        }
开发者ID:rbrunge,项目名称:phony-club-denmark,代码行数:26,代码来源:PageViewContextFactory.cs

示例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)
                };
        }
开发者ID:jeroenslor,项目名称:epi-alloy-demo-kit,代码行数:17,代码来源:PageViewContextFactory.cs

示例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)
                };
        }
开发者ID:SergVro,项目名称:FindExportImport,代码行数:22,代码来源:PageViewContextFactory.cs


注:本文中的System.Web.Routing.RequestContext.GetPageRoute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。