温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:Linq三层模式之增删改源码
当前文件路径:LinqDemo/Default.aspx

1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml"> 6
<head runat="server"> 7
<title>无标题页</title> 8
<style type="text/css"> 9
.style1 10
{ 11
width: 100%; 12
} 13
.style2 14
{ 15
width: 65px; 16
} 17
</style> 18
</head> 19
<body> 20
<form id="form1" runat="server"> 21
<div> 22
23
<asp:GridView ID="GridView1" DataKeyNames="id" runat="server" AutoGenerateColumns="False" 24
CellPadding="4" ForeColor="#333333" GridLines="None" 25
onrowcancelingedit="GridView1_RowCancelingEdit" 26
onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 27
Width="500px" onrowdeleting="GridView1_RowDeleting"> 28
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 29
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> 30
<Columns> 31
<asp:BoundField DataField="id" HeaderText="ID" ReadOnly="True" > 32
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 33
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 34
</asp:BoundField> 35
<asp:BoundField DataField="StaffName" HeaderText="staffName" > 36
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 37
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 38
</asp:BoundField> 39
<asp:BoundField DataField="staffage" HeaderText="staffAge" > 40
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 41
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 42
</asp:BoundField> 43
<asp:CommandField ShowEditButton="True" > 44
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 45
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 46
</asp:CommandField> 47
<asp:CommandField ShowDeleteButton="True" > 48
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 49
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" /> 50
</asp:CommandField> 51
</Columns> 52
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> 53
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> 54
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 55
<EditRowStyle BackColor="#999999" /> 56
<AlternatingRowStyle BackColor="White" ForeColor="#284775" /> 57
</asp:GridView> 58
59
</div> 60
<asp:Panel ID="Panel1" runat="server" Height="173px"> 61
<table class="style1"> 62
<tr> 63
<td class="style2"> 64
staffname</td> 65
<td> 66
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 67
</td> 68
</tr> 69
<tr> 70
<td class="style2"> 71
staffage</td> 72
<td> 73
<asp:TextBox ID="TextBox2" runat="server">25</asp:TextBox> 74
</td> 75
</tr> 76
<tr> 77
<td class="style2"> 78
</td> 79
<td> 80
<asp:Button ID="Button1" runat="server" Text="add" Width="35px" 81
onclick="Button1_Click" /> 82
<asp:Button ID="Button2" runat="server" Text="clear" /> 83
</td> 84
</tr> 85
</table> 86
</asp:Panel> 87
</form> 88
</body> 89
</html> 90



.style1

