product.aspx.cs
来自「很好的技术」· CS 代码 · 共 32 行
CS
32 行
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Product : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string productCode = Request.QueryString["Product"];
if (!IsPostBack)
{
if (string.IsNullOrEmpty(productCode))
this.FormView1.ChangeMode(FormViewMode.Insert);
}
}
protected void LinqDataSource1_Inserted(object sender, LinqDataSourceStatusEventArgs e)
{
Response.Redirect("ProductList.aspx");
}
protected void LinqDataSource1_Updated(object sender, LinqDataSourceStatusEventArgs e)
{
Response.Redirect("ProductList.aspx");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?