Showing posts with label AJAX Control Toolkit. Show all posts
Showing posts with label AJAX Control Toolkit. Show all posts

Wednesday, 23 January 2013

Simplest way to add a password strength indicator




Using ASP.NET AJAX Control toolkit:

<asp:TextBox ID="TextBox_Password" runat="server" Width="220px"></asp:TextBox>
<ajaxToolkit:PasswordStrength ID="PasswordStrength_Password" runat="server
   TargetControlID="TextBox_Password"
   DisplayPosition="RightSide"
 
   StrengthIndicatorType="BarIndicator"
 
   PreferredPasswordLength="8"
   MinimumNumericCharacters="1"
   MinimumSymbolCharacters="1"
   RequiresUpperAndLowerCaseCharacters="true"
 
   TextStrengthDescriptions="Very Poor;Weak;Average;Strong;Excellent"
   BarBorderCssClass="barIndicatorBorder"
   StrengthStyles="barIndicator_VeryPoor; barIndicator_Weak; barIndicator_Average; barIndicator_Strong; barIndicator_Excellent"

   CalculationWeightings="50;15;15;20" />


Styles in css:

/*Password strength bar*/
.barIndicatorBorder {
    border: solid 1px #c0c0c0;
    width: 200px;
}

.barIndicator_VeryPoor {
    background-color: red;
}

.barIndicator_Weak {
    background-color: orange;
}

.barIndicator_Average {
    background-color: lightblue;
}

.barIndicator_Strong {
    background-color: greenyellow;
}

.barIndicator_Excellent {
    background-color: green;
}


Wednesday, 15 August 2012

AJAX Control Toolkit Resizable Control handle disappears behinde Control

Increase X and\or Y offsets:


<ajaxToolkit:ResizableControlExtender ID="ReportViewer_Main_ResizableControlExtender" runat="server" Enabled="True" TargetControlID="ReportViewer_Main" HandleCssClass="HandleHand" HandleOffsetX ="16" HandleOffsetY ="0" MaximumHeight="600" MinimumHeight="600">



Note: Microsoft Report Viewer did not scale well when vertically re-sized, therefore I limited the re-size horizontally!

Thursday, 2 August 2012

Sanitizer provider is not configured in the web.config file. If you are using the HtmlEditorExtender with a public website then please configure a Sanitizer provider.


Sanitizer provider is not configured in the web.config file. If you are using the HtmlEditorExtender with a public website then please configure a Sanitizer provider. Otherwise, set the EnableSanitization property to false.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Exception: Sanitizer provider is not configured in the web.config file. If you are using the HtmlEditorExtender with a public website then please configure a Sanitizer provider. Otherwise, set the EnableSanitization property to false.




Place the below section just below the openieng of "<configuration>" tag within the file "web.config"


<configSections>
        <sectionGroup name="system.web">
            <section name="sanitizer" requirePermission="false" type="AjaxControlToolkit.Sanitizer.ProviderSanitizerSection, AjaxControlToolkit"/>
        </sectionGroup>
    </configSections>
    <system.web>
        <sanitizer defaultProvider="AntiXssSanitizerProvider">
            <providers>
                <add name="AntiXssSanitizerProvider" type="AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider"></add>
            </providers>
        </sanitizer>
    </system.web>


Anti-XSS can be easily obtained using NuGet. (Similar to previous post for installing AjaxControl Toolkit)

Visual Studio 2010 --> Tools --> Library Package Manager --> Package Manager Console -->
PM> Install-Package AntiXSS

You will get the below error if Anti-XSS is not installed:

Could not load type 'AjaxControlToolkit.Sanitizer.AntiXssSanitizerProvider'