manage.aspx.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*******************************************************************************
  2. * iNethinkCMS - 网站内容管理系统
  3. * Copyright (C) 2012-2013 inethink.com
  4. *
  5. * @author jackyang <69991000@qq.com>
  6. * @website http://cms.inethink.com
  7. * @version 1.3.6.0 (2013-08-14)
  8. *
  9. * This is licensed under the GNU LGPL, version 3.0 or later.
  10. * For details, see: http://www.gnu.org/licenses/gpl-3.0.html
  11. *******************************************************************************/
  12. using System;
  13. using System.Collections.Generic;
  14. using System.Web;
  15. using System.Web.UI;
  16. using System.Web.UI.WebControls;
  17. using iNethinkCMS.Helper;
  18. using iNethinkCMS.Command;
  19. using iNethinkCMS.Web.UI;
  20. namespace iNethinkCMS.Web.plugs.count
  21. {
  22. public partial class manage : Admin_BasePage
  23. {
  24. private string vXmlPath = @"/plugs/count/setting.xml";
  25. private string vState = "";
  26. private string vShow = "";
  27. protected void Page_Load(object sender, EventArgs e)
  28. {
  29. CheckUserPower("c");
  30. if (!IsPostBack)
  31. {
  32. if (Request.UrlReferrer != null)
  33. {
  34. ViewState["reJumpUrl"] = Request.UrlReferrer.AbsoluteUri;
  35. }
  36. else
  37. {
  38. ViewState["reJumpUrl"] = Request.Url.AbsoluteUri;
  39. }
  40. vState = XMLHelper.GetXmlAttribute(Server.MapPath(vXmlPath), "//plugs//config//key[@name=\"state\"]", "value").Value.Trim();
  41. vShow = XMLHelper.GetXmlAttribute(Server.MapPath(vXmlPath), "//plugs//config//key[@name=\"show\"]", "value").Value.Trim();
  42. this.txtState.SelectedValue = vState;
  43. this.txtShow.SelectedValue = vShow;
  44. }
  45. }
  46. protected void Button_Submit_Click(object sender, EventArgs e)
  47. {
  48. vState = this.txtState.SelectedValue;
  49. vShow = this.txtShow.SelectedValue;
  50. XMLHelper.CreateOrUpdateXmlAttributeByXPath(Server.MapPath(vXmlPath), "//plugs//config//key[@name=\"state\"]", "value", vState);
  51. XMLHelper.CreateOrUpdateXmlAttributeByXPath(Server.MapPath(vXmlPath), "//plugs//config//key[@name=\"show\"]", "value", vShow);
  52. Response.Redirect(ViewState["reJumpUrl"].ToString());
  53. }
  54. }
  55. }