in

dotNetFreak

Ramblings & Controls from a .NET Addicted Freak!

Kevin Gearing's Blog

October 2004 - Posts

  • New Control - StringCompareValidator - Provides Case Sensitive Comparisons

    If like me you've made use of the standard CompareValidator you'll know that it lacks one important feature for comparing strings - Case sensitivity. Whilst working on another control I needed a compare validator that had this capability, so I've created my own custom control - StringCompareValidator.


    Features:

    • CaseSensitive property to allow case-sensitive or case-insensitive comparisons.
    • CompareOperator property to allow equal or not equal comparisons.
    • Provides client-side and server-side validation.
    • Full Visual Studio .NET designer integration.


    Usage:

    Simply download, add to your toolbox, drag 'n' drop to your page and set the relevant properties using the property grid.


    Licensing & Download:

    Free for both personal and commercial use, however please consider donating!

    You may also redistribute the control royalty free, providing that you don't charge for it. Also, if you intend to distribute the control as part of an application which is publicly available it would be nice to know, although this isn't a requirement.

    To download, please visit the 'Downloads' area.


    Help & Support:

    Please post in the forum.

     

    Revision History:

    Updated 05/06/2007 (v2.0.0):

    Click here for details.

  • CasedTextBox Updated

    CasedTextBox has been updated. Click here for details.
  • DefaultValue and String Arrays

    Whilst creating a custom ASP.NET control I've come across a slight problem, namely the DefaultValue attribute and arrays...

    One of the properties of the control accepts a string array, but I can't for the life of me figure out how you set the DefaultValue to an array containing fixed values. I've tried just about every combination I can think of, all with no joy.

    I can obviously set the initial value when displayed in the designer by assigning the property a value from Public Sub New(), but I want to be able to 'Reset' the value (and avoid it being bold). As a workaround I've created a 'Resetxxxx' method which does reset the value when reset is clicked whilst right-clicking over the property in design mode, but doesn't remove the bold highlighting.

    If anyone knows how to use arrays with the DefaultValue attribute, please let me know.

Copyright ©2004-2007 Kevin Gearing. All Rights Reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems