/// <summary> /// Binds the data. /// </summary> private void BindData() { System.Web.UI.Control c = this.FindControl("trUploadedFiles"); trUploadedFiles.Attributes.Add("onMCFListRefresh", String.Format("javascript:StateChanged_{3}('{0}', '{1}', '{2}');", fvControl.ClientID, fuActions.ClientID, trUploadedFiles.ClientID, FileUpMetaValueCtrl.ClientID)); FileUrl.Visible = false; RemoveFile.Visible = false; /*HtmlTable uploadTable = this.FindControl("tblUpload") as HtmlTable; * if (uploadTable != null) * uploadTable.Visible = true;*/ MetaLabelCtrl.Text = String.Format("{0} ({1})", MetaField.FriendlyName, LanguageCode); MetaDescriptionCtrl.Text = MetaField.Description; if (MetaObject != null && MetaObject.GetFile(MetaField) != null) { MetaFile file = MetaObject.GetFile(MetaField); FileUrl.Text = String.Format("{0} ({1})", file.Name, Mediachase.FileUploader.Web.Util.CommonHelper.FormatBytes(Convert.ToInt64(file.Size))); RemoveFile.Visible = true; FileUrl.Visible = true; fuActions.Visible = false; /*if (uploadTable != null) * uploadTable.Visible = false;*/ } if (MetaField != null && !MetaField.AllowNulls) { RemoveFile.Visible = false; } //FileUpMetaValueCtrl.SessionUid = Guid.NewGuid(); }
/// <summary> /// Binds the data. /// </summary> private void BindData() { CurrentPicture.Visible = false; RemovePicture.Visible = false; MetaLabelCtrl.Text = String.Format("{0} ({1})", MetaField.FriendlyName, LanguageCode); string description = MetaField.Description; /* * if (MetaField.ImageProperty.AutoResizeImage) * description += String.Format("<br>Image will be auto resized to {0}x{1} (width x height)", MetaField.ImageProperty.ImageWidth, MetaField.ImageProperty.ImageHeight); * * if (MetaField.ImageProperty.AutoCreateThumbnailImage) * description += String.Format("<br>Thumbnail Image will be auto created with size of {0}x{1} (width x height)", MetaField.ImageProperty.ThumbWidth, MetaField.ImageProperty.ThumbHeight); * */ MetaDescriptionCtrl.Text = description; //MetaSingleValueField val = MetaField.SingleValueField; MetaFile file = MetaObject != null?MetaObject.GetFile(MetaField) : null; if (file != null) { if (file.Buffer != null && file.Buffer.Length > 0) { CaptionText.Text = file.Name; CurrentPicture.Visible = true; RemovePicture.Visible = true; CurrentPicture.Src = String.Format("~/Apps/Core/MetaData/Controls/ShowImage.aspx?classid={0}&objectid={1}&name={2}", MetaField.OwnerMetaClass.Id, MetaObject.Id, MetaField.Name); } } // Dont allow removing picture if null values are not allowed if (MetaField != null && !MetaField.AllowNulls) { RemovePicture.Visible = false; } }