Value must not be null for Controls and Behaviors

8 posts, 0 answers
  1. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 27 Oct 2011 Link to this post

    I have a RadComboBox in a PageView. When a user selects something from the combobox, I want to switch to a different PageView. However, I get the following error:

    Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.
    Parameter name: element


    My AjaxManager is setup with the following AjaxSetting:

    <telerik:AjaxSetting AjaxControlID="cboSchedules">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="tab" />
                        <telerik:AjaxUpdatedControl ControlID="mp" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
    "mp" is the RadMultiPage. I think this is happening because the control that starts the Ajax request, which is "cboSchedules", is hidden the action of selecting an item.

    First, am I right in this conclusion? Second, how do I get around it?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Oct 2011 Link to this post

    Hello Adam,

    I am not quite sure about your scenario. As far as I know, adding single tab or PageView in the RadAjaxManager settings is not supported. You should either add the whole MultiPage or TabStrip in AjaxSettings. Also check the following help documentation.
    Tips and tricks for ajaxifying specific controls.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 31 Oct 2011 Link to this post

    I am ajaxifying the entire multipage (id of "mp") and the entire tabview ("tab"). The cboSchedules RadComboBox is in the first pageview inside of the multipage.
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 01 Nov 2011 Link to this post

    Hi Adam,

    The appropriate settings for scenarios like your are the following:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="tab">
                <updatedcontrols>
                    <telerik:AjaxUpdatedControl ControlID="tab" />
                    <telerik:AjaxUpdatedControl ControlID="mp" />
                </updatedcontrols>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="mp">
                <updatedcontrols>
                    <telerik:AjaxUpdatedControl ControlID="tab" />
                    <telerik:AjaxUpdatedControl ControlID="mp" />
                </updatedcontrols>
            </telerik:AjaxSetting>
        </telerik:RadAjaxManager>


    All the best,
    Dimitar Terziev
    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
  6. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 03 Nov 2011 Link to this post

    That doesn't work. I get the same error only earlier on in the process. Let me map out what is happening a bit more.

    <tabs>
    <tab></tab>
    <tab></tab>
    </tabs>
    <mp>
    <page><combobox></combobox></page>
    <page></page>
    </mp>

    The user chooses a value in the combobox, which then fires off an ajax request. As part of the ajax request, page 1 no longer displays and page 2 starts displaying. The tabs also change to show that the second tab is selected. However, I get the error described when the combobox is the target control and the multipage and tabs are updated by the action performed on the combobox. If I tell it to only update the tabs, the tabs will update. The problem is when I tell it to update the multipage as a part of the combobox having an item selected.
  7. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 09 Nov 2011 Link to this post

    Hi Adam,

    I've prepared a sample page based on the scenario you have explained. Please test whether the page provided is working on your side and try to integrated the same approach in your scenario.

    Regards,
    Dimitar Terziev
    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
  8. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 09 Nov 2011 Link to this post

    Okay, that seems to be working for the most part. It appears that the piece I was missing was:

    ajxManager.AjaxSettings.AddAjaxSetting(cboSchedules, tab)
    ajxManager.AjaxSettings.AddAjaxSetting(cboSchedules, mp)

    What exactly does that do? It looks like I have to add it on ever page load because it doesn't keep the settings after callbacks/postbacks.

    The other issue that I'm having is that I had a lot of settings set up inside the ajaxmanager so that loading panels would appear over certain controls when other controls were selected inside the page view. All of those appear to have been replaced by the two ajax settings for the multipage and tabstrip.

    It almost appears those the best solution would have been to simply wrap everything inside of a RadUpdatePanel instead of using the specificity supplied by the ajax manager. Can you confirm why would choice would be better than another?
  9. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 14 Nov 2011 Link to this post

    Hi Adam,

    Regarding the setting I've added. The first one defines that the RadComboBox will update your RadTabStrip and the second one defines that again the RadComboBox will update the RadMultiPage. As you have noticed these setting should be added upon each post-back, otherwise they will be lost.

    As for your second question, in case you want all of your controls to make Ajax requests and not only specific ones, it's better to use RadAjaxPanel as you have mentioned.

    Greetings,
    Dimitar Terziev
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017