sys_seo.aspx.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.Command;
  18. using iNethinkCMS.Web.UI;
  19. namespace iNethinkCMS.Web.admin.sys
  20. {
  21. public partial class seo_settings : Admin_BasePage
  22. {
  23. iNethinkCMS.Model.Model_Config model = new iNethinkCMS.Model.Model_Config();
  24. iNethinkCMS.BLL.BLL_Config bll = new iNethinkCMS.BLL.BLL_Config();
  25. protected void Page_Load(object sender, EventArgs e)
  26. {
  27. CheckUserPower("e");
  28. if (!IsPostBack)
  29. {
  30. model = bll.GetModel_SeoConfig();
  31. this.txtAutoDescription.SelectedValue = model.AutoDescription;
  32. this.txtSeoTitle.Text = model.SeoTitle;
  33. this.txtIndexKeywords.Text = model.IndexKeywords;
  34. this.txtIndexDescription.Text = model.IndexDescription;
  35. }
  36. }
  37. protected void Submit_Seo_Setting_Click(object sender, EventArgs e)
  38. {
  39. model.AutoDescription = this.txtAutoDescription.SelectedValue.Trim();
  40. model.SeoTitle = this.txtSeoTitle.Text.Trim();
  41. model.IndexKeywords = Command.Command_StringPlus.LostHTML(this.txtIndexKeywords.Text.Trim());
  42. model.IndexDescription = Command.Command_StringPlus.LostHTML(this.txtIndexDescription.Text.Trim());
  43. if (bll.Update_SeoConfig(model))
  44. {
  45. MessageBox.Show(this, "SEO优化保存成功!");
  46. }
  47. else
  48. {
  49. MessageBox.Show(this, "SEO优化保存失败!");
  50. }
  51. }
  52. }
  53. }