settings.aspx.cs

来自「classfinalcs.rar .net 压缩包解压时不能有密码。」· CS 代码 · 共 36 行

CS
36
字号
using System;
using System.Web.UI.WebControls;

using AspNet.StarterKits.Classifieds.BusinessLogicLayer;

public partial class Settings_aspx : System.Web.UI.Page
{
	protected void Cancel_Click(object sender, EventArgs e)
	{
		Response.Redirect("~/Admin/Default.aspx");
	}

	protected void SettingsDataSource_Updated(object sender, ObjectDataSourceStatusEventArgs e)
	{
		// the UpdateSettings methods returns a boolean success value

		bool updateSuccess = false;
		if (e.ReturnValue != null && e.ReturnValue is bool)
			updateSuccess = (bool)e.ReturnValue;

		if (updateSuccess)
		{
			Response.Redirect("~/Admin/Default.aspx");
		}
		else
		{
			// we failed to save the settings to the settings file
			// but we can output its Xml equivalent for manual saving:
			SiteSettings s = SiteSettings.GetSharedSettings();
			SettingsXmlTextBox.Text = s.GetXml();

			UpdateErrorPanel.Visible = true;
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?