예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DDL_SiteList.DataSource     = adsSiteDal.SelectAllSite();
            DDL_SiteList.DataValueField = "SiteId";
            DDL_SiteList.DataTextField  = "SiteName";
            DDL_SiteList.DataBind();
            DDL_SiteList.Items.Insert(0, new ListItem("所有", Guid.Empty.ToString()));

            //显示网站名称和地址
            if (!string.IsNullOrEmpty(Request.QueryString["siteid"]))
            {
                try
                {
                    DDL_SiteList.SelectedValue = Request.QueryString["siteid"];
                    IList <SiteAdsInfo> list = new SiteAdsService().SelectSiteAdsById(new Guid(DDL_SiteList.SelectedValue));
                    RPT_AdsList.DataSource = list;
                    RPT_AdsList.DataBind();
                }
                catch (Exception ex) { }
            }

            DDL_AdsList.DataSource     = CacheCollection.GetAllAdsInfo();
            DDL_AdsList.DataValueField = "AdsId";
            DDL_AdsList.DataTextField  = "AdsName";
            DDL_AdsList.DataBind();
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DDL_SiteList.DataSource     = adsSiteDal.SelectAllSite();
            DDL_SiteList.DataValueField = "SiteUrl";
            DDL_SiteList.DataTextField  = "SiteName";
            DDL_SiteList.DataBind();
            DDL_SiteList.Items.Insert(0, new ListItem("所有", Guid.Empty.ToString()));

            //显示网站名称和地址
            if (!string.IsNullOrEmpty(Request.QueryString["url"]))
            {
                try
                {
                    IList <SiteAdsInfo> list = siteAdsDal.SelectAllSiteAds(Request.QueryString["url"]);
                    RPT_AdsList.DataSource = list;
                    RPT_AdsList.DataBind();

                    DDL_SiteList.SelectedValue = Request.QueryString["url"];
                }
                catch (Exception ex) { }
            }
        }
    }