This is a migrated thread and some comments may be shown as answers.
Sharepoint & Ajax
3 Answers 13 Views
This is a migrated thread and some comments may be shown as answers.
Hans
Top achievements
Rank 1
Hans asked on 28 Jun 2013, 01:48 AM
Hi,

I created many webparts for sharepoint using telerik and with all I have the same ajax "problem".
I will take an example
I have a webpart that contain a Tabstrip with many tabs. After the page is loaded and the tabstrip is shown, if I click another tab, a full page refresh occurs.Then if I press on another tab, the ajax is kicking in and only the tabstrip is refreshed.

The same for other controls, radgrid for example.

I used the both RadAjaxManager and RadAjaxPanel (not on the same page of course, but in different programs) and I have the same behaviour.

What I'm doing  wrong ?

Than you,
Hans

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 02 Jul 2013, 10:19 AM
Hello Hans,

Note that ajaxifying the telerik controls that are positioned within a user controls works somewhat differently from the scenario when they are loaded directly on a web form. In you case, you need to use RadAjaxManager control placed in the web part class instead of RadAjaxPanel. Create the manager there and add it to the Controls collection of the web part as follows:
private RadAjaxManager _ajaxManager;
  
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
  
    SetUpAjaxManagerOnPage();
  
    EnsureChildControls();
}
  
  
protected void SetUpAjaxManagerOnPage()
{
    RadAjaxManager currentAjaxManager = RadAjaxManager.GetCurrent(Page);
  
    if (currentAjaxManager == null)
    {
        Page.Form.Controls.AddAt(0, AjaxManager);
        Page.Items.Add(typeof(RadAjaxManager), AjaxManager);
    }
}
  
protected virtual RadAjaxManager AjaxManager
{
    get
    {
        if (_ajaxManager == null)
        {
            _ajaxManager = RadAjaxManager.GetCurrent(Page);
  
            if (_ajaxManager == null)
            {
                _ajaxManager = new RadAjaxManager() { ID = "RadAjaxManager1" };
            }
        }
  
        return _ajaxManager;
    }
}

Then in the OnLoad event of the web part, get the RadAjaxManager as follows:
RadAjaxManager _manager = RadAjaxManager.GetCurrent(Page);

and add your ajax settings programmatically. Beforehand, you should have the user control in the CreateChildControls method of the web part and there through FindControl you should retrieve the controls to ajaxify. Keep them in a private variable local to the web part class and use that in the OnLoad event to dynamically add the ajax settings.


Hope this information will prove helpful.

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
0
Hans
Top achievements
Rank 1
answered on 02 Jul 2013, 06:34 PM
Thank you very much !

It is working just fine on development server but I don't know why, is  working partially on the production server.

In a container I have a tabstrip and a radgrid. When I click on a tab, the radgrid is refreshing. This works on the both servers.
When I double click the grid, a popup windows is shown and the user can edit the record.This works on the development server only. On the production server the window popup is not shown and the entire webpart is frozen. I have to refresh the entire page . If I don't use the ajax, is working just fine even in the production server(The popup is shown).

What do I miss on the production server ?

Regards,

Hans
0
Maria Ilieva
Telerik team
answered on 05 Jul 2013, 08:57 AM
Hello Hans,

I suppose that the issue is related with incorrect ajax settings.

Please note that in case RadTabStrip/RadMultiPage is used the only correct approach for their ajaxification is to add the whole RadTabStrip and  MultiPage in the RadAjaxManager settings. So you should follow the instructions provided in the help topic below, with one exclusion- your settings should be programmatic:
http://www.telerik.com/help/aspnet-ajax/ajax-tips-and-tricks.html

Give this a try and let me know if it helps.

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
Tags
Ajax
Asked by
Hans
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Hans
Top achievements
Rank 1
Share this question
or