コード例 #1
0
    protected void GetLinkInfo()
    {
        int Lid = Int32.Parse(_Lid);

        model = bll.GetModel(Lid);
        if (model != null)
        {
            this._type         = model.DisplayMode.ToString();
            this.txtTitle.Text = model.Title;
            this.RadioButtonList1.SelectedValue = model.DisplayMode.ToString();
            this.DrCategory.SelectedValue       = model.CategoryId.ToString();
            this.txtLink.Text = model.Link;
            this.txtSort.Text = model.Sort.ToString();
            //显示图片
            if (model.Image != "")
            {
                ViewState["ImgLink"]      = model.Image;
                this.uploadimage.ImageUrl = mainPath + model.Image;
            }
            else
            {
                ViewState["ImgLink"]      = "";
                this.uploadimage.ImageUrl = "../../images/nopic.jpg";
            }
        }
    }
コード例 #2
0
 private void InitData(int id)
 {
     TFXK.Model.Link model = bll.GetModel(id);
     if (model != null)
     {
         hiddenPicPath.Value = model.logo;
         txtName.Text        = model.title;
         txtOrder.Text       = model.orderId + "";
         txtUrl.Text         = model.linkUrl;
         if (!string.IsNullOrEmpty(model.logo))
         {
             imgLink.ImageUrl = "../../uploads/" + model.logo;
         }
         ;
         ddlLinkType.SelectedValue = model.isPictureOn;
         txtDescription.Text       = model.description;
     }
 }