<asp:TextBox ID="TxtOldPs" runat="server" Width="150px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtOldPs"
Display="None" ErrorMessage="<b>友情提醒</b><br />请输入原始密码!!" ValidationGroup="ValidataGroup1"></asp:RequiredFieldValidator>
按钮事件:
<asp:Button ID="ButtonOK" runat="server" Text="修改" OnClick="Edit_Click" ValidationGroup="ValidataGroup1" />
另一个按钮 则不需要设置ValidationGroup
<asp:Button ID="ButtonOK" runat="server" Text="退出" OnClick="Exit_Click" />