5.1数据验证技术

来源:互联网 发布:南京浦口行知中学 编辑:程序博客网 时间:2024/06/06 14:27

空网页

<%@ 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>
        <table style="font-size: 9pt; width: 316px; height: 83px">
            <tr>
                <td align="center" colspan="2" style="font-size: 12pt">
                    用户信息</td>
                <td align="center" colspan="1" style="width: 119px">
                </td>
            </tr>
            <tr>
                <td style="width: 56px">
                    姓名:</td>
                <td style="width: 101px">
                    <asp:TextBox ID="txtName" runat="server" Width="94px"></asp:TextBox></td>
                <td style="width: 119px">
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtName"
                        ErrorMessage="姓名不能为空" SetFocusOnError="True"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td style="width: 56px">
                </td>
                <td style="width: 101px">
                    <asp:Button ID="btnCheck" runat="server" Text="验证" Width="40px" /></td>
                <td style="width: 119px">
                </td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>

0 0
原创粉丝点击