📄 studentedit.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="studentedit.aspx.cs" Inherits="studentedit" %>
<!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>
<script language="JavaScript">
function delete_confirm(e)
{
if (event.srcElement.outerText=="删除")
event.returnValue=confirm("您确定要删除吗?注意:此操作不可恢复,请谨慎操作!");
}
document.onclick=delete_confirm;
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="table1" align="center" border="0" cellpadding="2" cellspacing="0" style="font-size: 12px;
font-family: Tahoma; border-collapse: collapse; width: 100%;">
<tr>
<td style="width: 367px">
学号:<asp:TextBox ID="txtstuID" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="查询" Width="75px" /></td>
</tr>
<tr>
<td style="width: 367px; height: 28px;" align="center">
<asp:Label ID="errorbox" runat="server" ForeColor="#C00000" Text="Label" Visible="False"></asp:Label></td>
</tr>
<tr>
<td style="width: 367px; height: 172px;">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White"
BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal"
Height="154px" Width="600px" OnRowUpdating="GridView1_RowUpdating" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowDeleting="GridView1_RowDeleting" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<Columns>
<asp:TemplateField HeaderText="学号">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Sno") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Sno") %>'></asp:Label>
</EditItemTemplate>
<ControlStyle Height="7px" />
<ItemStyle Height="10px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="姓名">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("Name") %>' Width="64px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="院系">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>计算机科学系</asp:ListItem>
<asp:ListItem>中文系</asp:ListItem>
<asp:ListItem>数学系</asp:ListItem>
<asp:ListItem>电子系</asp:ListItem>
<asp:ListItem>艺术系</asp:ListItem>
<asp:ListItem>音乐系</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("Depart") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="年级">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Eval("Grade") %>' Width="45px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Grade") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="班级">
<EditItemTemplate>
<asp:TextBox ID="TextBox5" runat="server" Text='<%# Eval("Class") %>' Width="47px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("Class") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="编辑" ShowEditButton="True" />
<asp:CommandField ShowDeleteButton="True" />
</Columns>
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Center" Width="100%" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" Height="7px" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" Height="7px" Width="100%" />
</asp:GridView>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -