예제 #1
0
        private void HandlePagesWithNoStateCode()
        {
            // Build normalized uri
            switch (OriginalUri.AbsolutePath.ToLower())
            {
            case "/aboutus.aspx":
                NormalizedUri = UrlManager.GetAboutUsPageUri();
                break;

            case "/candidates.aspx":
                NormalizedUri = UrlManager.GetForCandidatesPageUri();
                break;

            case "/contactus.aspx":
                NormalizedUri = UrlManager.GetContactUsPageUri();
                break;

            case "/interns.aspx":
                NormalizedUri = UrlManager.GetForVolunteersPageUri();
                break;

            case "/parties.aspx":
                NormalizedUri = UrlManager.GetForPoliticalPartiesPageUri();
                break;

            case "/voters.aspx":
                NormalizedUri = UrlManager.GetForVotersPageUri();
                break;
            }
        }
예제 #2
0
        private void HandlePagesWithOnlyStateCode()
        {
            var stateCode = UrlManager.FindStateCode();

            if (string.IsNullOrEmpty(stateCode) || StateCache.IsValidStateCode(stateCode))
            {
                switch (OriginalUri.AbsolutePath.ToLower())
                {
                case "/":
                case "/default.aspx":
                    NormalizedUri = UrlManager.GetDefaultPageUri(stateCode);
                    break;

                case "/aboutus.aspx":
                    NormalizedUri = UrlManager.GetAboutUsPageUri(stateCode);
                    break;

                case "/contactus.aspx":
                    NormalizedUri = UrlManager.GetContactUsPageUri(stateCode);
                    break;

                case "/donate.aspx":
                    NormalizedUri = UrlManager.GetDonatePageUri(stateCode);
                    break;

                case "/forcandidates.aspx":
                    NormalizedUri = UrlManager.GetForCandidatesPageUri(stateCode);
                    break;

                case "/forresearch.aspx":
                    NormalizedUri = UrlManager.GetForResearchPageUri(stateCode);
                    break;

                case "/forpartners.aspx":
                    NormalizedUri = UrlManager.GetForPartnersPageUri(stateCode);
                    break;

                case "/forpoliticalparties.aspx":
                    NormalizedUri = UrlManager.GetForPoliticalPartiesPageUri(stateCode);
                    break;

                case "/forelectionauthorities.aspx":
                    NormalizedUri = UrlManager.GetForElectionAuthoritiesPageUri(stateCode);
                    break;

                case "/forvolunteers.aspx":
                    NormalizedUri = UrlManager.GetForVolunteersPageUri(stateCode);
                    break;

                case "/forvoters.aspx":
                    NormalizedUri = UrlManager.GetForVotersPageUri(stateCode);
                    break;

                case "/issuelist.aspx":
                    NormalizedUri = UrlManager.GetIssueListPageUri(stateCode);
                    break;

                case "/privacy.aspx":
                    NormalizedUri = UrlManager.GetPrivacyPageUri(stateCode);
                    break;
                }
            }
            else
            {
                ErrorMessage = "Invalid_StateCode";
            }
        }