⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx

📁 Visual C#2005程序设计教程
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="stuNo" DataSourceID="SqlDataSource1" AllowPaging="True">
            <EditItemTemplate>
                <strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 修改记录<br />
                    <br />
                </strong>
                <table style="width: 388px">
                    <tr>
                        <td style="width: 116px; height: 24px; text-align: center">
                            <span style="font-size: 10pt">学 号</span></td>
                        <td colspan="2" style="width: 309px; height: 24px">
                <asp:Label ID="stuNoLabel1" runat="server" Text='<%# Eval("stuNo") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 116px; text-align: center">
                            <span style="font-size: 10pt">姓 名</span></td>
                        <td colspan="2" style="width: 309px">
                <asp:TextBox ID="stuNameTextBox" runat="server" Text='<%# Bind("stuName") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 116px; text-align: center">
                            <span style="font-size: 10pt">性 别</span></td>
                        <td colspan="2" style="width: 309px">
                <asp:TextBox ID="stuSexTextBox" runat="server" Text='<%# Bind("stuSex") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 116px; text-align: center">
                            <span style="font-size: 10pt">年 龄</span></td>
                        <td colspan="2" style="width: 309px">
                <asp:TextBox ID="stuAgeTextBox" runat="server" Text='<%# Bind("stuAge") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 116px; text-align: center">
                            <span style="font-size: 10pt">政治面貌</span></td>
                        <td colspan="2" style="width: 309px">
                <asp:TextBox ID="stuPolityTextBox" runat="server" Text='<%# Bind("stuPolity") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 116px; text-align: center">
                            <span style="font-size: 10pt">籍 贯</span></td>
                        <td colspan="2" style="width: 309px">
                <asp:TextBox ID="stuHomeTextBox" runat="server" Text='<%# Bind("stuHome") %>'>
                </asp:TextBox></td>
                    </tr>
                </table>
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                    Text="更新" Font-Size="Smaller"></asp:LinkButton>
                <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消" Font-Size="Smaller"></asp:LinkButton>
            </EditItemTemplate>
            <InsertItemTemplate>
                <strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; 插入新记录<br />
                </strong>
                <br />
                <table style="width: 412px">
                    <tr>
                        <td style="width: 98px; text-align: center">
                            <span style="font-size: 10pt">学 号</span></td>
                        <td colspan="2">
                <asp:TextBox ID="stuNoTextBox" runat="server" Text='<%# Bind("stuNo") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 98px; height: 24px; text-align: center">
                            <span style="font-size: 10pt">姓 名</span></td>
                        <td colspan="2" style="height: 24px">
                <asp:TextBox ID="stuNameTextBox" runat="server" Text='<%# Bind("stuName") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 98px; text-align: center">
                            <span style="font-size: 10pt">性 别</span></td>
                        <td colspan="2">
                <asp:TextBox ID="stuSexTextBox" runat="server" Text='<%# Bind("stuSex") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 98px; text-align: center">
                            <span style="font-size: 10pt">年 龄</span></td>
                        <td colspan="2">
                <asp:TextBox ID="stuAgeTextBox" runat="server" Text='<%# Bind("stuAge") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 98px; text-align: center">
                            <span style="font-size: 10pt">政治面貌</span></td>
                        <td colspan="2">
                <asp:TextBox ID="stuPolityTextBox" runat="server" Text='<%# Bind("stuPolity") %>'>
                </asp:TextBox></td>
                    </tr>
                    <tr>
                        <td style="width: 98px; text-align: center">
                            <span style="font-size: 10pt">籍 贯</span></td>
                        <td colspan="2">
                <asp:TextBox ID="stuHomeTextBox" runat="server" Text='<%# Bind("stuHome") %>'>
                </asp:TextBox></td>
                    </tr>
                </table>
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                    Text="插入" Font-Size="Smaller"></asp:LinkButton>
                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                    Text="取消" Font-Size="Smaller"></asp:LinkButton>
            </InsertItemTemplate>
            <ItemTemplate>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>
                学生基本情况表<br />
                </strong>
                <table border="1" style="border-right: thin solid; border-top: thin solid; border-left: thin solid;
                    width: 278px; border-bottom: thin solid; text-align: left">
                    <tr>
                        <td style="width: 484px; text-align: center">
                            <span style="font-size: 10pt">学 号&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; text-align: left">
                            &nbsp;<asp:Label ID="stuNoLabel" runat="server" Text='<%# Eval("stuNo") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 484px; text-align: center">
                            <span style="font-size: 10pt">姓&nbsp; 名&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; text-align: left">
                            &nbsp;<asp:Label ID="stuNameLabel" runat="server" Text='<%# Bind("stuName") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 484px; text-align: center">
                            <span style="font-size: 10pt">性 别&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; text-align: left">
                            &nbsp;<asp:Label ID="stuSexLabel" runat="server" Text='<%# Bind("stuSex") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 484px; text-align: center">
                            <span style="font-size: 10pt">年 龄&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; text-align: left">
                            &nbsp;<asp:Label ID="stuAgeLabel" runat="server" Text='<%# Bind("stuAge") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 484px; text-align: center">
                            <span style="font-size: 10pt">政治面貌&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; text-align: left">
                            &nbsp;<asp:Label ID="stuPolityLabel" runat="server" Text='<%# Bind("stuPolity") %>'></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 484px; height: 24px; text-align: center">
                            <span style="font-size: 10pt">籍 贯&nbsp; </span>
                        </td>
                        <td colspan="2" style="width: 572px; height: 24px; text-align: left">
                            &nbsp;<asp:Label ID="stuHomeLabel" runat="server" Text='<%# Bind("stuHome") %>'></asp:Label></td>
                    </tr>
                </table>
                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"
                    Font-Size="Smaller" Text="编辑"></asp:LinkButton>
                <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"
                    Font-Size="Smaller" Text="删除"></asp:LinkButton>
                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
                    Font-Size="Smaller" Text="新建"></asp:LinkButton>
            </ItemTemplate>
        </asp:FormView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"
            ConnectionString="<%$ ConnectionStrings:studentConnectionString %>" DeleteCommand="DELETE FROM [StuInfo] WHERE [stuNo] = @original_stuNo AND [stuName] = @original_stuName AND [stuSex] = @original_stuSex AND [stuAge] = @original_stuAge AND [stuPolity] = @original_stuPolity AND [stuHome] = @original_stuHome"
            InsertCommand="INSERT INTO [StuInfo] ([stuNo], [stuName], [stuSex], [stuAge], [stuPolity], [stuHome]) VALUES (@stuNo, @stuName, @stuSex, @stuAge, @stuPolity, @stuHome)"
            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [StuInfo]"
            UpdateCommand="UPDATE [StuInfo] SET [stuName] = @stuName, [stuSex] = @stuSex, [stuAge] = @stuAge, [stuPolity] = @stuPolity, [stuHome] = @stuHome WHERE [stuNo] = @original_stuNo AND [stuName] = @original_stuName AND [stuSex] = @original_stuSex AND [stuAge] = @original_stuAge AND [stuPolity] = @original_stuPolity AND [stuHome] = @original_stuHome">
            <DeleteParameters>
                <asp:Parameter Name="original_stuNo" Type="String" />
                <asp:Parameter Name="original_stuName" Type="String" />
                <asp:Parameter Name="original_stuSex" Type="String" />
                <asp:Parameter Name="original_stuAge" Type="Int32" />
                <asp:Parameter Name="original_stuPolity" Type="String" />
                <asp:Parameter Name="original_stuHome" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="stuName" Type="String" />
                <asp:Parameter Name="stuSex" Type="String" />
                <asp:Parameter Name="stuAge" Type="Int32" />
                <asp:Parameter Name="stuPolity" Type="String" />
                <asp:Parameter Name="stuHome" Type="String" />
                <asp:Parameter Name="original_stuNo" Type="String" />
                <asp:Parameter Name="original_stuName" Type="String" />
                <asp:Parameter Name="original_stuSex" Type="String" />
                <asp:Parameter Name="original_stuAge" Type="Int32" />
                <asp:Parameter Name="original_stuPolity" Type="String" />
                <asp:Parameter Name="original_stuHome" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="stuNo" Type="String" />
                <asp:Parameter Name="stuName" Type="String" />
                <asp:Parameter Name="stuSex" Type="String" />
                <asp:Parameter Name="stuAge" Type="Int32" />
                <asp:Parameter Name="stuPolity" Type="String" />
                <asp:Parameter Name="stuHome" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <br />
    
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -