📄 requiredfield.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RequiredField.aspx.cs" Inherits="RequiredField" %>
<!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>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</head>
<body >
<form id="form1" runat="server">
<asp:TextBox ID="txtUserName" runat="server" style="z-index: 100; left: 135px; position: absolute; top: 55px"></asp:TextBox>
<asp:Label ID="lblName" runat="server" Style="z-index: 101; left: 38px; position: absolute;
top: 57px" Text="用户名" Width="77px"></asp:Label>
<asp:Label ID="lblPass" runat="server" Height="18px" Style="z-index: 102; left: 39px;
position: absolute; top: 89px" Text="密码" Width="72px"></asp:Label>
<asp:TextBox ID="txtPassWord" runat="server" Style="z-index: 103; left: 136px; position: absolute;
top: 87px" TextMode="Password" Width="147px"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Height="26px" OnClick="btnSubmit_Click"
Style="z-index: 104; left: 133px; position: absolute; top: 143px" Text="确认" Width="103px" />
<asp:RequiredFieldValidator ID="rfvPass" runat="server" ControlToValidate="txtPassWord"
ErrorMessage="请输入密码" Height="21px" Style="z-index: 105; left: 297px; position: absolute;
top: 87px" Width="100px"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="rfvName" runat="server" ControlToValidate="txtUserName"
ErrorMessage="请输入用户名" Style="z-index: 106; left: 299px; position: absolute; top: 56px"></asp:RequiredFieldValidator>
<asp:Label ID="lblMessage" runat="server" Style="z-index: 108; left: 40px; position: absolute;
top: 118px" Width="353px"></asp:Label>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -