示例#1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            var theme = VoiceService.GetTopTheme();

            if (theme == null || theme.Answers == null || !theme.Answers.Any() || !theme.IsDefault)
            {
                Visible = false;
                return;
            }
            try
            {
                if (Request.Browser.Cookies && Request.Cookies[_cookieCollectionNameVoting] == null)
                {
                    CommonHelper.SetCookieCollection(_cookieCollectionNameVoting, new NameValueCollection(), new TimeSpan(365, 0, 0, 0));
                }
            }

            catch (Exception ex)
            {
                Debug.LogError(ex);
            }
        }