Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bjørn Schaadt 9 posts 38 karma points
    Jul 26, 2013 @ 14:23
    Bjørn Schaadt
    0

    asp:changepassword - how can I Change labels?

    Hi,

    I'm having an issue which i could not find any answers to in this community.

    I want to change the default view of asp:changepassword.

    <form runat="server"> <asp:changepassword id="Changepassword1" runat="server" displayusername="true"> </asp:changepassword> </form>

    I basically want to rename the labels of this default rendering. From "password" to "kode" in danish.

    Should I use something like <changepasswordTemplate>  I'm really lost. An example would be nice, cause i can't proceed without this detail.

    Any help will be appreciated :)

     

  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Jul 26, 2013 @ 14:53
    Andy Butland
    100

    You can supply your own mark-up yes - in the <ChangePasswordTemplate> as you say.  Here's an example.  

    <asp:ChangePassword ID="changePassword" runat="server">
        <ChangePasswordTemplate>
            <fieldset>
                <asp:Label Text="Current password" AssociatedControlID="CurrentPassword" runat="server" /> 
                <asp:TextBox ID="CurrentPassword" TextMode="Password" runat="server" />
                <asp:Label Text="New password" AssociatedControlID="NewPassword" runat="server" /> 
                <asp:TextBox ID="NewPassword" TextMode="Password" runat="server" />
                <asp:Label Text="Confirm password" AssociatedControlID="ConfirmPassword" runat="server" /> 
                <asp:TextBox ID="ConfirmPassword" TextMode="Password" runat="server" />
                <asp:Button ID="ChangePassword" CommandName="ChangePassword" Text="Change Password" runat="server" />
            </fieldset>
            <asp:Label ID="FailureText" runat="server" />
        </ChangePasswordTemplate>
        <SuccessTemplate>
            <p>Password changed.</p>
        </SuccessTemplate>
    </asp:ChangePassword>
    

    If you just want to rename the label though, I think you can use the PasswordLabelText property.  See here for details.

  • Bjørn Schaadt 9 posts 38 karma points
    Jul 28, 2013 @ 20:35
    Bjørn Schaadt
    0

    Thanks Andy

    That's exactly what I needed to proceed :)

Please Sign in or register to post replies

Write your reply to:

Draft