コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //获取图书列表
                this.RpBookList.DataSource = CategoryManager.GetAllCategoryList();
                this.RpBookList.DataBind();

                //获取出版社信息
                this.rpPublisherList.DataSource = PublisherManager.GetPublishers();
                this.rpPublisherList.DataBind();
            }
        }
コード例 #2
0
ファイル: AddBook.aspx.cs プロジェクト: wwwLu/Lu-winner
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.PbId.DataTextField  = "Name";
                this.PbId.DataValueField = "Id";
                //绑定图书分类数据
                this.PbId.DataSource = CategoryManager.GetAllCategoryList();
                this.PbId.DataBind();
                this.PbId.Items.Insert(0, new ListItem("===请选择图书分类===", ""));



                //绑定出版社数据
                this.PublisherName.DataTextField  = "Name";
                this.PublisherName.DataValueField = "Id";
                this.PublisherName.DataSource     = PublisherManager.GetPublishers();
                this.PublisherName.DataBind();
                this.PublisherName.Items.Insert(0, new ListItem("===请选择出版社===", ""));
            }
        }