Tuesday, December 28, 2010

Change CSS style passwordstrenght meter in ASP.NET

Here You need to set CSS inside of head section in HTML page i.e. -


<style type="text/css">
.barIndicatorBorder {
border:solid 1px #c0c0c0;
width:200px;
}

.barIndicator_poor {
background-color:#EF0E17;
}

.barIndicator_weak {
background-color:#9F7779;
}

.barIndicator_good {
background-color:#3F373E;
}

.barIndicator_strong {
background-color:#2F0BBF;
}

.barIndicator_excellent {
background-color:#2F7F7D;  
}

.textbox {
border: solid 2px #cccccc;
border-top: solid 2px #a0a0a0;
}

</style>

HTML body element -

HTML body Element-
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <cc1:PasswordStrength ID="PasswordStrength1" runat="server"
            TargetControlID="txt_Password"
            TextStrengthDescriptions="Poor; Weak; Good; Strong; Excellent"
            TextStrengthDescriptionStyles="barIndicator_poor; barIndicator_weak; barIndicator_good; barIndicator_strong; barIndicator_excellent">
        </cc1:PasswordStrength>
        <br />
        <br />
&nbsp;&nbsp;&nbsp;
        <asp:Label ID="Label1" runat="server" Text="Enter Password"></asp:Label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="txt_Password" runat="server"></asp:TextBox>
        <br />
        <br />
   
    </div>
    </form>
</body>

Hope this is helpful for you.......

No comments:

Post a Comment