Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Trace.Write("wpTrafficNews Loading");
            try
            {
                Rotator1.Visible = true;
                DataSet dsNews = GetData();

                if (dsNews.Tables[3].Rows.Count > 1)
                {
                    Rotator1.DataSource = dsNews.Tables[3];
                    Rotator1.DataBind();
                }
                else
                {
                    Rotator1.Visible = false;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Write(ex.Message);
                Rotator1.Visible = false;
            }
            Trace.Write("wpTrafficNews Complete");
        }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool showNews = false;

        bool.TryParse(ConfigurationManager.AppSettings["RSS.TrafficNews"], out showNews);

        if (!showNews)
        {
            Rotator1.Visible = false;
            return;
        }

        try
        {
            DataSet dsNews = GetData();
            Rotator1.DataSource = dsNews;
            Rotator1.DataBind();
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.Write(ex.Message);
        }
    }