📄 example7.aspx
字号:
<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="C#" %>
<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
<mobile:Form runat="server" id="first">
Enter name:
<mobile:TextBox runat="server" id="name"/>
Enter password:
<mobile:TextBox runat="server" id="password" Password="true"/>
Confirm password:
<mobile:TextBox runat="server" id="confirm" Password="true"/>
<mobile:Command runat="server" id="enter" Onclick="enter_click"
Text="Enter"/>
<mobile:RequiredFieldValidator runat="server" ControlToValidate="name"
ErrorMessage="Please enter a name" />
<mobile:RequiredFieldValidator runat="server"
ControlToValidate="password"
ErrorMessage="Please enter a password" />
<mobile:RequiredFieldValidator runat="server" ControlToValidate="confirm"
ErrorMessage="Please confirm your password" />
<mobile:CompareValidator runat="server" ControlToValidate="confirm"
ControlToCompare="password"
ErrorMessage="Confirmation must match password" />
</mobile:Form>
<mobile:Form runat="server" id="second">
<mobile:ValidationSummary runat="server" formToValidate="first"
HeaderText="Invalid input"/>
</mobile:Form>
<mobile:Form runat="server" id="third">
<mobile:Label runat="server">Input accepted.</mobile:Label>
</mobile:Form>
<script runat="server">
public void enter_click(Object sender, System.EventArgs e)
{
if (Page.IsValid)
ActiveForm = third;
else
ActiveForm = second;
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -