Пример #1
0
        private void ProcessRequest(FriendlyUrlSettings settings, UrlTestHelper testHelper)
        {
            var provider = new AdvancedUrlRewriter();

            provider.ProcessTestRequestWithContext(HttpContext.Current,
                                    HttpContext.Current.Request.Url,
                                    true,
                                    testHelper.Result,
                                    settings);
            testHelper.Response = HttpContext.Current.Response;
        }
Пример #2
0
        public void Init(HttpApplication application)
        {
            _providerToUse = DotNetNuke.Common.Utilities.Config.GetFriendlyUrlProvider();

            //bind events depending on currently configured friendly url provider
            //note that the current configured friendly url provider determines what type 
            //of url rewriting is required.

            switch (_providerToUse)
            {
                case "advanced":
                    var advancedRewriter = new AdvancedUrlRewriter();
                    _urlRewriter = advancedRewriter;
                    //bind the rewrite event to the begin request event
                    application.BeginRequest += _urlRewriter.RewriteUrl;
                    break;
                default:
                    var basicRewriter = new BasicUrlRewriter();
                    _urlRewriter = basicRewriter;
                    application.BeginRequest += _urlRewriter.RewriteUrl;
                    break;
            }
        }