Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var substitutions = new Substitutions();

            if (DomainData.IsValidStateCode) // Single state
            {
                Title =
                    $"{PublicMasterPage.SiteName} | {substitutions.Substitute(TitleTagDefaultPageSingleStateDomain)}";
                MetaDescription = substitutions.Substitute(MetaDescriptionTagDefaultPageSingleStateDomain);
            }
            else // use the All states domain
            {
                Title =
                    $"{PublicMasterPage.SiteName} | {substitutions.Substitute(TitleTagDefaultPageAllStatesDomain)}";
                MetaDescription = substitutions.Substitute(MetaDescriptionTagDefaultPageAllStatesDomain);
            }

            // My Sample Ballot Buttons

            var             cookies   = LocationCookies.GetCookies();
            List <LinkInfo> links     = null;
            var             stateCode = DomainData.FromQueryStringOrDomain;

            if (cookies.IsValid)
            {
                links = GetRecentSampleBallotLinks(cookies);
            }
            ExplorerLinkBox.Visible = false;

            SetupHeading(cookies, links);

            if (DomainData.IsValidStateCode)
            {
                CreateUpcomingLinks(stateCode);
            }
            else
            {
                UpcomingLinkBox.Visible = false;
            }

            GetLinkBox(PresidentLinks, "US President and Vice-President",
                       ForResearchPage.GetPresidentLinks());
            GetLinkBox(SenateLinks, "US Senate",
                       ForResearchPage.GetSenateLinks());
            GetLinkBox(HouseLinks, "US House of Representatives",
                       ForResearchPage.GetHouseLinks());
            GetLinkBox(GovernorLinks,
                       "State Governors and Lieutenant Governors",
                       ForResearchPage.GetGovernorLinks());

            if (DomainData.IsValidStateCode)
            {
                ForResearchPage.AddStateLinksToDiv(ElectionResults, stateCode, false, false);
            }
            else
            {
                ElectionResultsLinkBox.Visible = false;
            }
        }
Example #2
0
 public string Do(Substitutions s, Options o)
 {
     return(Fn(s, o)
            .SafeString());
 }