Cannot get sub control to ajaxify

6 posts, 0 answers
  1. Lee
    Lee avatar
    3 posts
    Member since:
    Jun 2010

    Posted 30 Jun 2010 Link to this post

    Hi,
    I am trying out ASP.NET Ajax RadControls and have an issue with ajaxifying a specific control on a sub ASCX control.

    I have ajaxified the buttons on the main page ok. But no matter what I have tried on the sub ASCX i cannot get the radcombobox to fire the onselectedindexchanged event.

    The heirarchy is as follows...
    - Default.aspx
        - Content_RegistrationLookup.ascx
            - Sub_VehicleBrowser.ascx
                - RadComboBox_Make (this is the control I wish to ajaxify to update RadComboBox_Model)

    So there are two nested ascx controls. I have tried the following...

     

    • Putting this on the Page_Load event of Sub_VehicleBrowser.ascx to add the ajax setting to the main page manager

    RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(RadComboBox_Make, RadComboBox_Model, RadAjaxLoadingPanel1)

     

    • Using a RadAjaxManagerProxy with the same setting as coded above in the Sub_VehicleBrowser.ascx control
    • Wrapping the RadComboBoxes in Panels and using the Panels as the update controls in RadAjaxManager

    The entire visual studio 2010 project so far can be downloaded here http://www.ignitioncarparts.co.uk/cpc.zip.

    I would be very grateful for any help.

    Thanks,
    Lee

  2. SamJ
    SamJ avatar
    101 posts
    Member since:
    Jul 2008

    Posted 01 Jul 2010 Link to this post

    Hi Lee,

    What RadAjax does is to turn the regular postbacks into callbacks. Therefore the RadComboBox SelectedIndex change should fire either with ajax enabled or disabled.
    Can you confirm you have set the AutoPostBack property of the RadComboBox control to true?

    Thanks,
    SamJ
  3. Lee
    Lee avatar
    3 posts
    Member since:
    Jun 2010

    Posted 01 Jul 2010 Link to this post

    Thanks for your reply. I have tried all the scenarios as mentioned with the autopostback set to true and also set to false.

    When set to false nothing happens, when set to true the page Content_RegistrationLookup.ascx does a full postback returning a blank white page.

    Lee
  4. SamJ
    SamJ avatar
    101 posts
    Member since:
    Jul 2008

    Posted 01 Jul 2010 Link to this post

    Please excuse me if I was not clear enough. In order the RadComboBox to initiate postback as soon as its selection is changed the AutoPostBack property should be set to true. Otherwise it is expected no postback to happen and the server event not to fire. And to turn the postback in callback you can use RadAjax. But before ajaxifying the page you should first make sure it works as expected without ajax, but with regular postback.
    From then on, if ajaxified controls still postback, you can check this article for resolution:
    http://www.telerik.com/help/aspnet-ajax/ajxcontrolstillpostbacks.html

    If it does not help, send a sample code illustrating your true scenario and the issue.

    Regards,
    SamJ



  5. Lee
    Lee avatar
    3 posts
    Member since:
    Jun 2010

    Posted 03 Jul 2010 Link to this post

    Setting AutoPostBack to True causes the event to fire, but as a full postback, not an ajaxified one.
    The source code can be found at http://www.ignitioncarparts.co.uk/cpc.zip.

    Regards,
    Lee
  6. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 05 Jul 2010 Link to this post

    Hello Lee,

    I have responded to your support ticket. Plase, close the current forum thread and leave the discussion to the formal ticket one.

    For the sake of helping other people that might encounter a similar problem, the solution is to set the AutoPostBack property to true and add the necessary ajax settings.

    Regards,
    Tsvetoslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top