protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["FCKeditor:UserFilesPath"] = ConfigurationManager.AppSettings["UserFilePath"]; if (CurrentPage != 0) { //BindData(); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPage(CurrentPage); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxEnPageTitle.Text = ds.Tables[0].Rows[0]["EnPageTitle"].ToString(); uiTextBoxArPageTitle.Text = ds.Tables[0].Rows[0]["ArPageTitle"].ToString(); uiFCKeditorEnContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["EnPageContent"].ToString()); uiFCKeditorArContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString()); } uiPanelCurrentPages.Visible = false; uiPanelCurrent.Visible = true; } else { uiPanelCurrentPages.Visible = true; uiPanelCurrent.Visible = false; BindData(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPage(6); uiLiteralTitle.Text = ds.Tables[0].Rows[0]["ArPageTitle"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLayer db = new DBLayer(); DataSet ds = db.GetPage(4); if (ds.Tables[0].Rows[0]["ArPageContent"].ToString().Length > 250) { uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString().Substring(0, 250)); } else { uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString()); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["PID"] != null && !string.IsNullOrEmpty(Request.QueryString["PID"].ToString())) { int id = Convert.ToInt32(Request.QueryString["PID"].ToString()); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPage(id); uiLiteralTitle.Text = ds.Tables[0].Rows[0]["ArPageTitle"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString()); } else { Response.Redirect("~/home.aspx"); } } }
protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditPage") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentPage = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPage(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxEnPageTitle.Text = ds.Tables[0].Rows[0]["EnPageTitle"].ToString(); uiTextBoxArPageTitle.Text = ds.Tables[0].Rows[0]["ArPageTitle"].ToString(); uiFCKeditorEnContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["EnPageContent"].ToString()); uiFCKeditorArContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["ArPageContent"].ToString()); } uiPanelCurrentPages.Visible = false; uiPanelCurrent.Visible = true; } }