1. 程式人生 > >.net驗證控件

.net驗證控件

號碼 oval compare required 驗證控件 font .net asp 是否

1.判斷是否為空的驗證

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="手機號碼不能為空" ControlToValidate="txtname" Font-Size="Smaller" 
                    ForeColor="Red"></asp:RequiredFieldValidator>

2.判斷兩個值是否一致

<asp:CompareValidator ID="CompareValidator1" runat="
server" ErrorMessage="密碼不一致" ControlToCompare="txtpassword" ControlToValidate="txtpasswordb"></asp:CompareValidator>

.net驗證控件