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

Updating Controls during an Ajax Request that originates within a user web control

1 Answer 87 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
stevenaricci
Top achievements
Rank 1
stevenaricci asked on 04 Jan 2012, 05:08 AM

Hello.  Here is my situation. 

1.  I have a webform named CUSTOMERS.ASPX, it has an AJAX PROXY CONTROL ON IT.  It uses a master page named default.master that has the it has an AJAX CONTROL MANAGER CONTROL on it.

2. This web form (CUSTOMERS.ASPX) has a radTabStrip on it

3. This web form (CUSTOMERS.ASPX) has a radMultipage on it (that is NOT hooked to the tabstrip to switch pageview when tab is clicked)

4. On one of the pageviews of the radmultipage, there is a custom control (GRID.ASCX) it has an ID of grdAllCustomers.

5.  The GRID.ASCX contains a radgrid control on it and an also has AJAX PROXY control on it.  The radgrid is set to autopostback on rowclick.  I use the item_command event to capture rowclicks server side.

Symptom:
when I click a row in the radgrid (which in the GRID.ASCX control), it fires the item_command event in that control.  I then raise that event using raiseevent so that it raises it in the customers.aspx page.  This works, but when I try to change the active tab of the radtab control (which is inside the customers.aspx page), the tab control does not update.

It is strange that in the ajax proxy control on the customers.aspx page, I cannot see the grdAllCustomers custom control.  I would think that I would need to ajaxify the grdAllCustomers control in the customers.aspx page (using the ajax proxy).  But the control is not there.  If i try to ajaxify the control manually by setting up the control in the ajax proxy in the HTML markup but then i get a javascript error.

Am i missing something?  The custom control and the content page and the master page are all blended together into a single page, so the ajax should work and I should be able update the controls during the ajax partial postback - right? 

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 05 Jan 2012, 10:27 AM
Hello,

One option is to directly add a setting in the aspx page where the tab strip and multipage are updating:
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
        </UpdatedControls>
    </telerik:AjaxSetting>
    <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>

This is also a recommended approach if you want a child control in the tabstrip to update it on postback.

This way, on any postback action in the tabstrip/multipage, the whole tabstrip structure gets refresed via AJAX.

All the best,
Tsvetina
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
stevenaricci
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or