Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Captcha > problem Radcombobox load on demand with Radcaptcha

Not answered problem Radcombobox load on demand with Radcaptcha

Feed from this thread
  • john mirzaei avatar

    Posted on Apr 11, 2012 (permalink)

    hi all
    i have problem with requestItems() method in Radcombobox .it causes postback page and captcha generates new code but not shows it  to user .i searched forum and you suggest use RadXmlHttpPanel but how can i change this code :

    <script type="text/javascript">
    //global variables for the countries and cities comboboxes
    var countriesCombo;
    var citiesCombo;
     
    function pageLoad()
    {
        // initialize the global variables
        // in this event all client objects
        // are already created and initialized
        countriesCombo = $find("<%= RadComboBox2.ClientID %>");   
        citiesCombo = $find("<%= RadComboBox3.ClientID %>");
    }
     
    function LoadCountries(sender, eventArgs)
    {   
        var item = eventArgs.get_item();
        countriesCombo.set_text("Loading...");
        citiesCombo.clearSelection();
         
        // if a continent is selected
        if (item.get_index() > 0)
        {       
            // this will fire the ItemsRequested event of the
            // countries combobox passing the continentID as a parameter
            countriesCombo.requestItems(item.get_value(), false);                               
        }
        else
        {
            // the -Select a continent- item was chosen
            countriesCombo.set_text(" ");
            countriesCombo.clearItems();
             
            citiesCombo.set_text(" ");
            citiesCombo.clearItems();
        }
    }
     
    function LoadCities(sender, eventArgs)
    {   
        var item = eventArgs.get_item();
         
        citiesCombo.set_text("Loading...");
        // this will fire the ItemsRequested event of the
        // cities combobox passing the countryID as a parameter
        citiesCombo.requestItems(item.get_value(), false);                   
    }
     
    function ItemsLoaded(sender, eventArgs)
    {   
        if (sender.get_items().get_count() > 0) {
            // pre-select the first item
            sender.set_text(sender.get_items().getItem(0).get_text());
            sender.get_items().getItem(0).highlight();
        }
     
        sender.showDropDown();
    }
            </script>

    i don't want captcha changes code when items load on comboboxes?

    thanks

    Reply

  • john mirzaei avatar

    Posted on Apr 11, 2012 (permalink)

    HI

    I solved my problem by implementing a custom captcha validation and http handler...
    http://www.telerik.com/community/forums/aspnet-ajax/captcha/radcaptcha-on-ajax-page.aspx

    thanks

    Reply

  • Slav Slav admin's avatar

    Posted on Apr 12, 2012 (permalink)

    Hello John,

    There is another option to prevent the change of the RadCaptcha code on Ajax request. You can use its property CaptchaImage-PersistCodeDuringAjax, which is designed especially for such scenarios. The following sample shows how to setup it:
    <telerik:RadCaptcha runat="server" ID="RadCaptcha1" ErrorMessage="Wrong code" CaptchaImage-PersistCodeDuringAjax="true">
    </telerik:RadCaptcha>

    Greetings,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Captcha > problem Radcombobox load on demand with Radcaptcha
Related resources for "problem Radcombobox load on demand with Radcaptcha"

ASP.NET Captcha Features  |  Documentation  |  Demos  | Step-by-step Tutorial  ]