protected void Page_Load(object sender, EventArgs e) { //ViewState["AssID"] = Convert.ToInt32(Request.QueryString["id2"]); CKFinder.FileBrowser fileBrowser = new CKFinder.FileBrowser(); fileBrowser.BasePath = "ckfinder"; //CKFinder路径 fileBrowser.SetupCKEditor(CKEditorControl1); UnobtrusiveValidationMode = new UnobtrusiveValidationMode(); }
protected void Page_Load(object sender, EventArgs e) { UnobtrusiveValidationMode = new UnobtrusiveValidationMode(); if (!IsPostBack) { try { if (Session["isadmin"] != null) { if (Session["isadmin"].ToString() != "1") { Response.Redirect("~/Annonymous/Home.aspx"); } } if (Session["id"] == null) { Response.Redirect("~/Annonymous/Home.aspx"); } ddl_category.DataSource = Category.getAll(); ddl_category.DataTextField = "Category_Name"; ddl_category.DataValueField = "Category_id"; ddl_category.DataBind(); if (Session["prodid"] != null) { DataTable dt = products.getByid(int.Parse(Session["prodid"].ToString())); txt_prodName.Text = dt.Rows[0][1].ToString(); txt_prodDesc.Text = dt.Rows[0][2].ToString(); txt_prodPrice.Text = dt.Rows[0][3].ToString(); txt_prodQuantity.Text = dt.Rows[0][6].ToString(); ddl_category.SelectedValue = dt.Rows[0][5].ToString(); img_prod.ImageUrl = dt.Rows[0][4].ToString(); txt_prodProm.Text = dt.Rows[0][7].ToString(); } else { Response.Redirect("~/Admin/HomeAdmin.aspx"); } } catch (Exception ex) { LogError.Error(ex, System.Reflection.MethodBase.GetCurrentMethod().Name); } } }
protected void Page_Load(object sender, EventArgs e) { CKFinder.FileBrowser fileBrowser = new CKFinder.FileBrowser(); fileBrowser.BasePath = "ckfinder"; //CKFinder路径 UnobtrusiveValidationMode = new UnobtrusiveValidationMode(); }
protected void Page_Load(object sender, EventArgs e) { CKFinder.FileBrowser fileBrowser = new CKFinder.FileBrowser(); fileBrowser.BasePath = "../ckfinder/"; //设置CKFinder的基路径 fileBrowser.SetupCKEditor(txtContent); UnobtrusiveValidationMode = new UnobtrusiveValidationMode(); int id; if (!IsPostBack) { #region 前台panel控件可见与否 if (Request.QueryString["menupanel"] != null) { #region a1可见 if (Request.QueryString["menupanel"] == "a1") { a1.Visible = true; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region b1可见 if (Request.QueryString["menupanel"] == "b1") { a1.Visible = false; b1.Visible = true; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region b2可见 if (Request.QueryString["menupanel"] == "b2") { a1.Visible = false; b1.Visible = false; b2.Visible = true; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region c1可见 if (Request.QueryString["menupanel"] == "c1") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = true; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region c2可见 if (Request.QueryString["menupanel"] == "c2") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = true; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region c3可见 if (Request.QueryString["menupanel"] == "c3") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = true; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region c4可见 if (Request.QueryString["menupanel"] == "c4") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = true; d1.Visible = false; d2.Visible = false; d3.Visible = false; } #endregion #region d1可见 if (Request.QueryString["menupanel"] == "d1") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = true; d2.Visible = false; d3.Visible = false; } #endregion #region d2可见 if (Request.QueryString["menupanel"] == "d2") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = true; d3.Visible = false; } #endregion #region d3可见 if (Request.QueryString["menupanel"] == "d3") { a1.Visible = false; b1.Visible = false; b2.Visible = false; c1.Visible = false; c2.Visible = false; c3.Visible = false; c4.Visible = false; d1.Visible = false; d2.Visible = false; d3.Visible = true; } #endregion } #endregion #region 如果用户登录了,将用户信息绑定 overlogin.Visible = false; nologin.Visible = false; //如果用户登录了,将用户信息绑定 if (Session["User_Name"] != null) { overlogin.Visible = true; //绑定ACG BindAcg(); //绑定评论 BindComments(); //绑定留言 BindLeavewords(); //绑定他人评论 BindTComments(); //绑定他人留言 BindTLea(); //绑定被评论 BindReplyComments(); //绑定被回复 BindReplyLeavewords(); SqlDataReader dt = UserInfoService.users(int.Parse(Session["User_ID"].ToString())); dt.Read(); if (dt != null) { UserName.Text = dt[1].ToString(); UserEmail.Text = dt[4].ToString(); //Image1.ImageUrl = dt[3].ToString(); //UserPhone.Text = dt[5].ToString(); UserImg.ImageUrl = dt[3].ToString(); } #region 修改用户信息 if (Request.QueryString["queren"] != null) { if (ChangMima.Text.Trim() == ChangMima2.Text.Trim()) { UserInfo user = new UserInfo(); user.User_ID = int.Parse(Session["User_ID"].ToString()); user.User_Name = ChangName.Text.Trim(); user.User_Password = ChangMima.Text.Trim(); user.User_Phone = ChangPhone.Text.Trim(); user.User_Email = ChangEmail.Text.Trim(); user.User_Img = "Img\\UserImg\\" + ChangImg.PostedFile.FileName; if (UserInfoService.usersupdate(user) == 1) { //Session["UserImg"] = @"~/User_Img/" + FileUpload_img.PostedFile.FileName; Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('修改成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(object), "alert", "<script>alert('修改失败!');</script>"); } } else { Page.ClientScript.RegisterClientScriptBlock(typeof(object), "alert", "<script>alert('前后密码不一致!');</script>"); } } #endregion } else { nologin.Visible = true; } #endregion try { #region Acg投稿数据绑定和删除 if (Request.QueryString["proid"] != null) { id = Convert.ToInt32(Request.QueryString["proid"].ToString()); if (AcgService.delete(id) == 1) { BindAcg(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion #region 用户评论删除 if (Request.QueryString["commentsid"] != null) { id = Convert.ToInt32(Request.QueryString["commentsid"].ToString()); if (CommentService.usersDelete(id) == 1) { BindComments(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion #region 用户回复数据绑定和删除 if (Request.QueryString["Leavewordsid"] != null) { id = Convert.ToInt32(Request.QueryString["Leavewordsid"].ToString()); if (LeavewordsService.usersDelete(id) == 1) { BindLeavewords(); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除删除失败!');</script>"); } } #endregion } catch (Exception ex) { } } }