This is a migrated thread and some comments may be shown as answers.

Value must not be null for Controls and Behaviors

7 Answers 213 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 27 Oct 2011, 10:01 PM
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?

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Oct 2011, 10:10 AM
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.
0
Adam
Top achievements
Rank 1
answered on 31 Oct 2011, 02:33 PM
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.
0
Dimitar Terziev
Telerik team
answered on 01 Nov 2011, 12:19 PM
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
0
Adam
Top achievements
Rank 1
answered on 03 Nov 2011, 06:52 PM
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.
0
Dimitar Terziev
Telerik team
answered on 09 Nov 2011, 07:52 AM
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
0
Adam
Top achievements
Rank 1
answered on 09 Nov 2011, 05:01 PM
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?
0
Dimitar Terziev
Telerik team
answered on 14 Nov 2011, 11:28 AM
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
Tags
Ajax
Asked by
Adam
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Adam
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or