MS Ajax FilteredTextBox stopped working

Posted by TenaciousImpy on Stack Overflow See other posts from Stack Overflow or by TenaciousImpy
Published on 2010-03-18T21:29:26Z Indexed on 2010/03/18 21:31 UTC
Read the original article Hit count: 541

Filed under:
|
|
|
|

Hi,

I'm using Microsoft's AJAX library via their CDN. Everything was going fine in an old project. I then created a new project and copied and pasted some of the AJAX code hoping that it would work. However, my code isn't working and I've been struggling to figure out why. I'm trying to implement a filtered textbox:

        <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.js" type="text/javascript"></script> 
 <script src="http://ajax.microsoft.com/ajax/beta/0911/Start.debug.js" type="text/javascript"></script>  
    <script src="http://ajax.microsoft.com/ajax/beta/0911/extended/ExtendedControls.debug.js" type="text/javascript"></script>  


<script type="text/javascript">
    $(document).ready(function() {




        Sys.require(Sys.components.filteredTextBox, function() {
            $("[id$='UserName']").filteredTextBox({
                InvalidChars: ".",
                FilterType: Sys.Extended.UI.FilterTypes.Numbers | Sys.Extended.UI.FilterTypes.UppercaseLetters | Sys.Extended.UI.FilterTypes.LowercaseLetters | Sys.Extended.UI.FilterTypes.Custom,
                FilterMode: Sys.Extended.UI.FilterModes.ValidChars
            });

        });
    });

</script>

When I run this, the textbox isn't filtered and I can enter any character. In Chrome, I used the Dev Tools and it found two errors on the page. In my .aspx page, I have: Uncaught TypeError: Cannot read property 'Numbers' of undefined (regarding the Sys.Extended.UI.FilterTypes.Numbers in the code above).

In filteredtextboxbehavior.debug.js, I have the error: Uncaught TypeError: Object #<an Object> has no method 'registerComponent'

Any ideas why I'm getting this error? The code has been working previously so I'm not sure if I had added any extra settings in my old project which the new one doesn't have.

Thanks!

ps:The textbox can be found as any other actions on it are recognized.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about AJAX