protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定稿件栏目 ddlColumn.DataSource = ArticleManager.GetArticleColumnList(); ddlColumn.DataTextField = "ArticleColumn_Name"; ddlColumn.DataValueField = "ArticleColumn_ID"; ddlColumn.DataBind(); //绑定稿件类型 ddlType.DataSource = ArticleManager.GetArticleTypeList(); ddlType.DataTextField = "ArticleType_Name"; ddlType.DataValueField = "ArticleType_ID"; ddlType.DataBind(); //设置署名作者 this.txtAuthorName.Value = (Session["UserInfo"] as GeneralUser).RealName; //获取稿件类 int ArticleID = Convert.ToInt32(Session["ArticleForModify"]); Article article = ArticleManager.GetArticleInfoById(ArticleID); //填充页面字段 this.txtChineseTitle.Value = article.ChineseTitle; this.txtEnglishTitle.Value = article.EnglishTitle; this.txtChineseResume.Value = article.ChineseResume; this.txtEnglishResume.Value = article.EnglishResume; this.txtChineseKey.Value = article.ChineseKey; this.txtEnglishKey.Value = article.EnglishKey; this.ddlColumn.SelectedValue = article.ArticleColumnId.ToString(); this.ddlType.SelectedIndex = article.ArticleTypeInfo.Id; this.txtCount.Value = article.WordCount.ToString(); this.txtAuthorResume.Text = article.AuthorIntro; this.txtEMail.Value = article.Email; } }
/// <summary> /// 加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //绑定稿件栏目 ddlColumn.DataSource = ArticleManager.GetArticleColumnList(); ddlColumn.DataTextField = "ArticleColumn_Name"; ddlColumn.DataValueField = "ArticleColumn_ID"; ddlColumn.DataBind(); //绑定稿件类型 ddlType.DataSource = ArticleManager.GetArticleTypeList(); ddlType.DataTextField = "ArticleType_Name"; ddlType.DataValueField = "ArticleType_ID"; ddlType.DataBind(); //设置署名作者 this.txtAuthorName.Value = (Session["UserInfo"] as GeneralUser).RealName; } }