Web/EntityFramework/Demo.aspx
(完整代码) 1KB<%@ Page Title="添加、查询、更新和删除的Demo" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Demo.aspx.cs" Inherits="EntityFramework_Demo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<div style="margin: 10px;">
CategoryName:<asp:TextBox ID="txtCategoryName" runat="server" />
Description:<asp:TextBox ID="txtDescription" runat="server" />
<asp:Button ID="btnAddCategory" runat="server" Text="添加产品类别" OnClick="btnAddCategory_Click" />
</div>
<div style="margin: 10px;">
<asp:GridView ID="GridView1" DataKeyNames="CategoryID" runat="server" AutoGenerateColumns="false"
OnRowDeleting="GridView1_RowDeleting" OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="ID" ReadOnly="true" />
<asp:BoundField DataField="CategoryName" HeaderText="CategoryName" />
<asp:BoundField DataField="Description" HeaderText="Description" />
<asp:CommandField ShowSelectButton="True" ShowEditButton="True" ShowDeleteButton="True">
</asp:CommandField>
</Columns>
</asp:GridView>
</div>
<div style="margin: 10px;">
<asp:GridView ID="GridView2" runat="server">
</asp:GridView>
</div>
</asp:Content>
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
