locations.aspx.cs
来自「classfinalcs.rar .net 压缩包解压时不能有密码。」· CS 代码 · 共 35 行
CS
35 行
using System;
using System.Web.UI.WebControls;
using AspNet.StarterKits.Classifieds.BusinessLogicLayer;
using AspNet.StarterKits.Classifieds.Web;
public partial class Locations_aspx : System.Web.UI.Page
{
protected void RemoveLocationButton_Click(object sender, EventArgs e)
{
if (this.LocationsListBox.SelectedIndex != -1)
{
int locationId = Convert.ToInt32(LocationsListBox.SelectedValue);
LocationsDB.RemoveLocation(locationId);
LocationCache.ClearAll(Context);
LocationsListBox.DataBind();
}
}
protected void AddLocationButton_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
string location = Server.HtmlEncode(this.NewLocationTextBox.Text);
LocationsDB.InsertLocation(location);
LocationCache.ClearAll(Context);
LocationsListBox.DataBind();
NewLocationTextBox.Text = String.Empty;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?