public override string GetDesignTimeHtml() { FCKeditor control = (FCKeditor)Component; return(String.Format(CultureInfo.InvariantCulture, "<div><table width=\"{0}\" height=\"{1}\" bgcolor=\"#f5f5f5\" bordercolor=\"#c7c7c7\" cellpadding=\"0\" cellspacing=\"0\" border=\"1\"><tr><td valign=\"middle\" align=\"center\">FCKeditor V2 - <b>{2}</b></td></tr></table></div>", control.Width, control.Height, control.ID)); }
public EditorField(Column c, string v) { this.ID = c.ColumnName; this.panel = Builder.GetPanel(c); TableCell cell2 = ((System.Web.UI.WebControls.Table)panel.Controls[0]).Rows[0].Cells[1]; FredCK.FCKeditorV2.FCKeditor editor = new FredCK.FCKeditorV2.FCKeditor(); editor.ID = c.ColumnName + "_value"; editor.Value = v; editor.Height = 460; cell2.Controls.Add(editor);//把编辑器对象添加到页面上。 if (c.Required) { cell2.Controls.Add(Validatas.GetRequired(c)); } }
protected virtual void CreateDescriptionRow() { _descriptionLabel = new Label(); _descriptionLabel.Text = "Description"; _description = new FCKeditor(); _description.ToolbarSet = "Basic"; _description.Width = Unit.Pixel(500); //_description.BaseHref = "http://skylab/castroller"; _description.BasePath = "~/fckeditor/"; _mainTable.Rows.Add(GenerateTableRow(_descriptionLabel, false, _description, null)); }
protected override void CreateChildControls() { htmlContentTxt = new FCKeditor(); htmlContentTxt.ImageBrowserURL = "/fckeditor/fileUpload.aspx"; htmlContentTxt.ToolbarSet = "MyToolbar"; htmlContentTxt.Width = 525; htmlContentTxt.Height = 500; Controls.Add(htmlContentTxt); }
public FCKeditorAdapter() { _Control = new FCKeditor(); _Control.BasePath = "~/FCKeditor/"; }
protected void Viewedit_ItemCommand(object sender, FormViewCommandEventArgs e) { try { string command = e.CommandArgument.ToString(); if (e.CommandName == "Capnhat") { obj_BDS obj = new obj_BDS(); obj.maBDS = int.Parse(command); TextBox tenbds = (TextBox)Viewedit.FindControl("txtTenBDS"); obj.tenBDS = tenbds.Text.ToString(); TextBox diachi = (TextBox)Viewedit.FindControl("txtDiachi"); obj.diachi = diachi.Text.ToString(); TextBox gia = (TextBox)Viewedit.FindControl("txtGia"); obj.gia = gia.Text.ToString(); FredCK.FCKeditorV2.FCKeditor noidung = (FredCK.FCKeditorV2.FCKeditor)Viewedit.FindControl("fckNoidung"); obj.noidung = noidung.Value; obj.ghichu = ""; CheckBox daban = (CheckBox)Viewedit.FindControl("chkDaBan"); obj.daban = daban.Checked; DropDownList khuvuc = (DropDownList)Viewedit.FindControl("drlKhuvuc"); obj.maKV = Convert.ToInt32(khuvuc.SelectedItem.Value.ToString()); DropDownList loaibds = (DropDownList)Viewedit.FindControl("drlLoaiBDS"); obj.maLoaiBDS = Convert.ToInt32(loaibds.SelectedItem.Value.ToString()); CheckBox noibat = (CheckBox)Viewedit.FindControl("chkNoiBat"); obj.noibat = noibat.Checked; TextBox youtube = (TextBox)Viewedit.FindControl("txtyoutube"); obj.youtube = youtube.Text.ToString(); string anhdaidien, anhct = "", stranhct = ""; FileUpload txtanhdaidien = (FileUpload)Viewedit.FindControl("txtanhdaidien"); Label lblanhdaidien = (Label)Viewedit.FindControl("lblanhdaidien"); if (txtanhdaidien.FileName == "" && lblanhdaidien.Text != "") { anhdaidien = lblanhdaidien.Text.ToString().Replace("Images/nhadat/", ""); } else if (txtanhdaidien.FileName != "") { //anhdaidien = Server.MapPath("..\\Images\\nhadat\\" + txtanhdaidien.FileName); anhdaidien = Server.MapPath("~/Images/nhadat/" + txtanhdaidien.FileName); txtanhdaidien.PostedFile.SaveAs(anhdaidien); anhdaidien = txtanhdaidien.FileName; } else { anhdaidien = "Empty.jpg"; } obj.hinhanh = anhdaidien; FileUpload txtanhct = (FileUpload)Viewedit.FindControl("txtanhct"); Label lblanhct = (Label)Viewedit.FindControl("lblanhct"); GridView gv = (GridView)Viewedit.FindControl("gv_tenfile"); if (txtanhct.FileName == "") { DataTable dt = new DataTable(); dt = (DataTable)Session["anhct"]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { stranhct += dt.Rows[i]["anhct"].ToString().Replace("Images/nhadat/", "") + ","; } } } else if (txtanhct.HasFiles) { foreach (HttpPostedFile uploadedFile in txtanhct.PostedFiles) { uploadedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Images/nhadat/"), uploadedFile.FileName)); stranhct += uploadedFile.FileName + ","; } } int tt = admin.BUS_ql_batdongsan(obj, 2, stranhct); Label thongbao = (Label)Viewedit.FindControl("lblthongbao"); if (tt != 0) { laydsBDS(); //thongbao.Text = "Cập nhật thành công!"; lblthongbao.Text = "Cập nhật thành công!"; //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "An_hien_tbao()", true); } else { lblthongbao.Text = "Thêm thất bại.Vui lòng kiểm tra lại!"; //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "An_hien_tbao()", true); } } } catch { } }