how do i set the number of characters generated?

Apr 11, 2008 at 1:56 AM
Fantastic control, really nice and easy to setup...

question how do I set the maximum number of characters generated? I want it to be 4... any more than that I feel my users will start to get frustrated. I couldn't find anywhere in the documentation that tells you where to specify it.
Apr 11, 2008 at 2:24 AM
Edited Apr 11, 2008 at 2:31 AM


dmose wrote:
Fantastic control, really nice and easy to setup...

question how do I set the maximum number of characters generated? I want it to be 4... any more than that I feel my users will start to get frustrated. I couldn't find anywhere in the documentation that tells you where to specify it.


nevermind figured it out..great control thanks!
Coordinator
Apr 11, 2008 at 3:20 AM
Hi,

I'll answer the question anyway in case others would like to know :)

The number of characters is chosen at random between minimum and maximum values that are specified on the default text provider. The defaults are 4 and 6, respectively.

You can change the default values by registering a text provider in the web.config file and specifying values for the minimumCharacters and maximumCharacters attributes.

The following example sets the minimum to 3 characters and the maximum to 4 characters.

<autoInputProtection defaultTextProvider="basic English">
  <textProviders>
    <add name="basic English" minimumCharacters="3" maximumCharacters="4"
         type="DaveSexton.Web.Controls.BasicEnglishAutoInputProtectionTextProvider, DaveSexton.AutoInputProtection"
  </textProvider>
</autoInputProtection>

- Dave