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


C# UrlAction.SetActionWithNoDowngrade方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Urls.UrlAction.SetActionWithNoDowngrade方法的典型用法代码示例。如果您正苦于以下问题:C# UrlAction.SetActionWithNoDowngrade方法的具体用法?C# UrlAction.SetActionWithNoDowngrade怎么用?C# UrlAction.SetActionWithNoDowngrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Urls.UrlAction的用法示例。


在下文中一共展示了UrlAction.SetActionWithNoDowngrade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTabFromDictionary


//.........这里部分代码省略.........
                                        if (rewriteParms && isSiteRootMatch)
                                        {
                                            //set rewrite parameters to take tabid for site root matches
                                            SetRewriteParameters(ref result, newUrl);
                                        }

                                        //if the parms weren't rewritten by means of a regex, then process them normally
                                        if (!rewriteParms && !isSiteRootMatch)
                                        //can only try other matches if it wasn't a site root match
                                        {
                                            //put those parms on the back of the url as a query string 
                                            string cultureCode;
                                            newUrl = RewriteParameters(newUrl,
                                                                        tabKeyVal,
                                                                        urlParms,
                                                                        result,
                                                                        langParms,
                                                                        settings,
                                                                        out cultureCode);
                                            if (cultureCode != null) //set culture code if not already set
                                            {
                                                result.CultureCode = cultureCode;
                                            }
                                        }
                                        //now check if the request involved a page pageAndExtension, (.aspx) and shouldn't have 
                                        if (!finished)
                                        {
                                            //944 : don't switch to 301 redirect if action already set to 404
                                            if ((settings.PageExtensionUsageType == PageExtensionUsageType.Never
                                                 || settings.PageExtensionUsageType == PageExtensionUsageType.PageOnly) &
                                                hadExtension)
                                            {
                                                //948 : use new 'no downgrade' method
                                                result.SetActionWithNoDowngrade(ActionType.CheckFor301);
                                            }
                                            else
                                                //866 : redirect back from no extension to extension if it didn't have one
                                                if (settings.PageExtensionUsageType != PageExtensionUsageType.Never &&
                                                    hadExtension == false)
                                                {
                                                    //948 : use new 'no downgrade' method
                                                    result.SetActionWithNoDowngrade(ActionType.CheckFor301);
                                                }
                                        }

                                        if (isSiteRootMatch && !finished)
                                        //when it was a site root match, this must be matched with a custom parameter regex
                                        {
                                            //only finished if the parms were rewritten by means of a regex rewrite
                                            reWritten = rewriteParms;
                                            finished = rewriteParms;
                                        }
                                        else
                                        {
                                            //rewriting done
                                            reWritten = true;
                                            finished = true;
                                        }
                                    }
                                    else
                                    {
                                        //determine the url action and redirect reason from embedded tokens in the url rewrite path
                                        string resultUrl;
                                        RedirectReason reason;
                                        ActionType action;
                                        //add back language parameters if they were there
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:67,代码来源:RewriteController.cs


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