GridViewUp.aspx
<% @ Page Language = " C# " AutoEventWireup = " true " CodeFile = " GridViewUp.aspx.cs " Inherits = " gridview_GridViewUp " %> <! DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " > < html xmlns = " http://www.w3.org/1999/xhtml " > < head runat = " server " > < title > 无标题页 </ title > </ head > < body > < form id = " form1 " runat = " server " > < div > < table cellpadding = " 0 " cellspacing = " 0 " border = " 0 " width = " 80% " style = " font-size: 11px " > < tr > < td align = " center " > < asp:GridView ID = " GridView1 " runat = " server " Width = " 100% " CellPadding = " 4 " ForeColor = " #333333 " AutoGenerateColumns= " False " AllowPaging = " True " PageSize = " 12 " OnRowCancelingEdit = " GridView1_RowCancelingEdit " OnRowEditing= " GridView1_RowEditing " OnRowUpdating = " GridView1_RowUpdating " OnRowDeleting = " GridView1_RowDeleting " DataKeyNames= " id,name " OnPageIndexChanging = " GridView1_PageIndexChanging " DataMember = " card,price " OnRowDataBound = " GridView1_RowDataBound " GridLines = " None " > < Columns > < asp:BoundField HeaderText = " 编号 " DataField = " id " ReadOnly = " True " /> < asp:BoundField DataField = " name " HeaderText = " 姓名 " ReadOnly = " True " /> < asp:TemplateField HeaderText = " 身份证号 " > < ItemTemplate > <% # Eval( " card " ) %> </ ItemTemplate > < EditItemTemplate > < asp:TextBox ID = " TBCard " Text = ' <%# Eval("card") %> ' runat = " server " Width = " 140px " /> </ EditItemTemplate > < ItemStyle Width = " 150px " /> </ asp:TemplateField > < asp:TemplateField HeaderText = " 学历 " > < ItemTemplate > <% # Eval( " xueliText " ) %> </ ItemTemplate > < EditItemTemplate > < asp:HiddenField ID = " HDFXueli " runat = " server " Value = ' <%# Eval("xueli") %> ' /> < asp:DropDownList ID = " DDLXueli " runat = " server " Width = " 90px " /> </ EditItemTemplate > < ItemStyle Width = " 100px " /> </ asp:TemplateField > < asp:TemplateField HeaderText = " 价格 " > < ItemTemplate > <% # Eval( " price " ) %> </ ItemTemplate > < EditItemTemplate > < asp:TextBox ID = " TBPrice " Text = ' <%# Eval("price") %> ' runat = " server " Width = " 90px " /> </ EditItemTemplate > < ItemStyle Width = " 100px " /> </ asp:TemplateField > < asp:BoundField HeaderText = " 建立时间 " DataField = " createdate " ReadOnly = " True " /> < asp:CommandField ShowDeleteButton = " True " ShowEditButton = " True " HeaderText = " 操作 " /> </ Columns > < PagerSettings FirstPageText = "" LastPageText = "" NextPageText = "" PreviousPageText = "" /> < RowStyle Height = " 20px " BackColor = " #F7F6F3 " ForeColor = " #333333 " /> < FooterStyle BackColor = " #5D7B9D " Font - Bold = " True " ForeColor = " White " /> < EditRowStyle BackColor = " #999999 " /> < SelectedRowStyle BackColor = " #E2DED6 " Font - Bold = " True " ForeColor = " #333333 " /> < PagerStyle BackColor = " #284775 " ForeColor = " White " HorizontalAlign = " Center " /> < HeaderStyle BackColor = " #5D7B9D " Font - Bold = " True " ForeColor = " White " /> < AlternatingRowStyle BackColor = " White " ForeColor = " #284775 " /> </ asp:GridView > </ td > </ tr > </ table > </ div > </ form > </ body > </ html >
GridViewUp.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class gridview_GridViewUp : System.Web.UI.Page
CREATE TABLE [ dbo ] . [ test01 ] ( [ id ] [ decimal ] ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , [ name ] [ varchar ] ( 50 ) COLLATE Chinese_PRC_CI_AS NULL , [ card ] [ varchar ] ( 50 ) COLLATE Chinese_PRC_CI_AS NULL , [ xueli ] [ varchar ] ( 50 ) COLLATE Chinese_PRC_CI_AS NULL , [ price ] [ decimal ] ( 18 , 0 ) NULL , [ createdate ] [ datetime ] NULL ) ON [ PRIMARY ] GO ALTER TABLE [ dbo ] . [ test01 ] ADD CONSTRAINT [ DF_test01_createdate ] DEFAULT ( getdate ()) FOR [ createdate ] , CONSTRAINT [ PK_test01 ] PRIMARY KEY CLUSTERED ( [ id ] ) ON [ PRIMARY ] GO
相关文章:
2022-12-23
2021-08-24
2022-12-23
2021-08-06
2021-11-16
2022-12-23
2022-12-23
相关资源
下载
2021-06-24
下载
2023-02-02
下载
2021-06-06
下载
2021-06-26