日期:2014-01-21  浏览次数:20515 次


前台

<%...@ Page language="c#" Codebehind="WebForm5.aspx.cs" AutoEventWireup="false" Inherits="csdn.WebForm5" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>WebForm5</title>
        <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
        <meta content="C#" name="CODE_LANGUAGE">
        <meta content="JavaScript" name="vs_defaultClientScript">
        <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    </HEAD>
    <body>
        <form id="Form1" method="post" runat="server">
            <asp:textbox id="TextBox1" runat="server" Width="88px"></asp:textbox>
            <asp:TextBox id="TextBox2" runat="server" Width="40px"></asp:TextBox>
            <asp:Button id="Button1" runat="server" Text="添加"></asp:Button>
            <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False" DataKeyField="ID" AllowPaging="True"
                PageSize="5" OnEditCommand="edit" OnCancelCommand="cancel" OnUpdateCommand="update">
                <Columns>
                    <asp:TemplateColumn HeaderText="姓名">
                        <ItemTemplate>
                            <%...# DataBinder.Eval(Container.DataItem,"vName") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox id="name" Runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"vName") %>' Width="88px">
                            </asp:TextBox>
                        </EditItemTemplate>