ChangeWord控件的自定义模板的实现

 <asp:ChangePassword ID="ChangePassword1" runat="server" BackColor="#F7F7DE" BorderColor="#CCCC99"
         BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt">
            <TitleTextStyle BackColor="#6B696B" Font-Bold="True" ForeColor="#FFFFFF" />
                <ChangePasswordTemplate>
                    <table border="0" cellpadding="0" style="width: 312px">
                        <tr>
                            <td align="center" colspan="2">
                            更改密码
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="CurrentPasswordLabel" runat="server" 
                                AssociatedControlID="CurrentPassword">密码:
                                </asp:Label>
                            </td>
                            <td style="width: 198px">
                                <asp:TextBox ID="CurrentPassword" runat="server" TextMode="Password">
                                </asp:TextBox>
                                <asp:RequiredFieldValidator ID="CurrentPasswordRequired" runat="server" 
                                ControlToValidate="CurrentPassword"
                                 ErrorMessage="必须填写密码。" ToolTip="b必须填写密码。" 
                                 ValidationGroup="ChangePassword1"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="NewPasswordLabel1" runat="server"
                                AssociatedControlID="NewPassword">
                                新密码:
                                </asp:Label>
                             </td>
                                <td style="width: 198px">
                                    <asp:TextBox ID="NewPassword" runat="server" TextMode="Password">
                                    </asp:TextBox>
                                    <asp:RequiredFieldValidator ID="NewPasswordRequired" runat="server"
                                    ControlToValidate="NewPassword" ErrorMessage="必须填写新密码。" ToolTip="必须填写新密码"
                                     ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Label ID="ConfirmNewPasswordLabel" runat="server"
                                AssociatedControlID="ConfirmNewPassword">
                                确认新密码:
                                </asp:Label>
                                </td>
                                <td style="width: 198px">
                                    <asp:TextBox ID="ConfirmNewPassword" runat="server" TextMode="Password">
                                    </asp:TextBox>
                                    <asp:RequiredFieldValidator ID="ConfirmNewPasswordRequired" runat="server"
                                    ControlToValidate="ConfirmNewPassword" ErrorMessage="必须填写“确认新密码”。" ToolTip="必须填写确认新密码"
                                     ValidationGroup="ChangePassword1">*</asp:RequiredFieldValidator>
                                </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2">
                                <asp:CompareValidator ID="NewPasswordCompare" runat="server" 
                                ControlToCompare="NewPassword" ControlToValidate="ConfirmNewPassword" 
                                Display="Dynamic" ErrorMessage="“确认新密码”与“新密码”项必须匹配。"
                                  ValidationGroup="Changepassword1"></asp:CompareValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" style="height: 24px">
                                <asp:Literal ID="FailureText" runat="server" EnableViewState="false"></asp:Literal>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" style="height: 24px">
                                <asp:Button ID="ChangePasswordPushButton" runat="server"
                                  CommandName="ChangePasword" Text="更改密码" ValidationGroup="ChangePassword1"/>
                            </td>
                            <td style="height: 24px; width: 198px" >
                                <asp:Button ID="CancelPushButton" runat="server" CausesValidation="false" CommandName="Cancel"
                                 Text="取消" />
                            </td>
                        </tr>
                    </table>
                </ChangePasswordTemplate>
                <SuccessTemplate>
                    你的密码已更改!
                    <asp:Button ID="ContinuePushButton" runat="server" CausesValidation="false" Text="继续" />
                </SuccessTemplate>
        </asp:ChangePassword>
posted @ 2008-06-18 20:58  不染丹心  阅读(306)  评论(0编辑  收藏  举报