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

Ajax in SharePoint 2010

6 Answers 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephan Moeller
Top achievements
Rank 1
Stephan Moeller asked on 26 May 2010, 04:17 PM
Hi,
I'm using Telerik Ajax Manager/RadAjaxPanel/RadAjaxLoadingPanel inside SharePoint 2010 Webparts.

The problem is that the AjaxLoadingPanel is displayed just after the second request.
In the first request the website loads normal without any LoadingPanel.

How can I fix this error ?

Thanx and regards
Stephan

6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 01 Jun 2010, 08:14 AM
Hello Stephan,

The presented issue could appear if you are adding the RadAjaxManager in the WebPart. In this case the AjaxSettings will be added in the WebPart PageLoad event and not in the initial PaegLoad. I suggest you to move the RadAjaxManager in the Master Page of the application and see if this will make any difference.


Kind regards,
Maria Ilieva
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.
0
Stephan Moeller
Top achievements
Rank 1
answered on 02 Jun 2010, 10:15 AM
Hi Maria,
I put it in the mastpage, but it has no effect on it. Still no LoadingPanel on first request.
Thanx
Stephan

.
.
.
</head>
<body scroll="no" onload="if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();" class="v4master"> 
  <form runat="server" onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}">
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
  <telerik:RadScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>
 <WebPartPages:SPWebPartManager id="m" runat="Server"/>
<SharePoint:SPNoScript runat="server"/>
.
.
.
0
Maria Ilieva
Telerik team
answered on 04 Jun 2010, 01:42 PM
Hi,

Could you please elaborate a little bit more on your scenario? Please let me know how the Ajax settings are added and where (in the MasterPage or in the WebPart).


Kind regards,
Maria Ilieva
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.
0
USI
Top achievements
Rank 1
answered on 29 Nov 2010, 05:25 PM
Hello,

I have the same problem with Ajax in Sharepoint 2010. First request refresh the entire page and next requests are ajaxified. The other problem is that the loading panel does not show on ajax requests.

I already put the RadScriptManager in my master page and the LoadingPanel is outside the panel that is refreshed.

I already search for answers in other posts but I did not found the answer. Here is my code:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PesquisaDocenteUserControl.ascx.cs" Inherits="WebAcademicos.Presentation.WebParts.Publico.PesquisaDocente.PesquisaDocenteUserControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
 
<h1 id="ContentTitleZone" runat="server" class="ms-rteElement-H1"></h1>
 
<h2 id="ContentDescriptionZone" runat="server" class="ms-rteElement-H2"></h2>
 
 
<asp:Panel ID="MessageBox" runat="server">
     
</asp:Panel>
 
<div class="criteria-zone">  
    <div class="left-side"></div>
    <div class="middle-side">
        <div style="height: 6px;"></div>
        <div style="float: left; padding-top: 4px">
            <asp:Label ID="LabelFiltroDocente"
                        runat="server" 
                        Text="<%$ Resources:PesquisaDocente, LabelDocente %>"
                        CssClass="label LabelFiltroDocente"
                        AssociatedControlID="ValueFiltroDocente"/>
        </div>
               
        <div style="float: left; margin-right: 5px;">
            <telerik:RadTextBox ID="ValueFiltroDocente"
                                runat="server"                            
                                EmptyMessage="<%$ Resources:PesquisaDocente, HelpFiltroDocente %>"
                                ontextchanged="ValueFiltroDocente_TextChanged"
                                Width="266px"/>    
        </div>
 
        <div style="float: left; padding-top: 4px">
            <asp:Label ID="LabelFiltroUnidadeOrganicaEnsino"
                        runat="server" 
                        Text="<%$ Resources:PesquisaDocente, LabelUnidadeOrganicaEnsino %>"
                        CssClass="label LabelFiltroUnidadeOrganicaEnsino"
                        AssociatedControlID="ValueFiltroUnidadeOrganicaEnsino"/>
        </div>
 
        <div style="float: left; width: 140px; margin-right: 5px;"> <!-- No IE fica a 100%, dai o DIV para limitar o tamanho em largura-->
            <telerik:RadComboBox ID="ValueFiltroUnidadeOrganicaEnsino" runat="server"
                DataValueField="Codigo" DataTextField="Abreviatura"
                AccessibilityMode="true" Width="100%" AutoPostBack="false"
                onselectedindexchanged="ValueFiltroUnidadeOrganicaEnsino_SelectedIndexChanged" />
        </div>
                 
        <asp:Button ID="BtnPesquisar" runat="server" Text="<%$ Resources:PesquisaDocente, LabelPesquisar %>"
            onclick="BtnPesquisar_Click" />
     
    </div>
     
    <div class="right-side"></div>
    <div style="clear: both"></div>
</div>
<asp:Panel ID="AjaxPanel" runat="server">
 
    <asp:Panel ID="NoResultsPanel" runat="server" CssClass="no-results">
        <div id="GridMessage" runat="server"></div>
    </asp:Panel>
 
    <div id="GridZone" class="grid-zone" runat="server">  
        <div id="docentes-grid" class="left-zone">
            <telerik:RadGrid ID="GridResultadosPesquisa"
                                AutoGenerateColumns="false"                                                      
                                Height="299px"
                                ShowStatusBar="false"
                                runat="server"
                                AllowPaging="True"
                                AllowSorting="true"
                                AllowCustomPaging="True"
                                OnNeedDataSource="ResultadosPesquisa_NeedDataSource"
                                CssClass="hided-caption"
                                OnSortCommand="GridResultadosPesquisa_SortCommand"                           
                                OnSelectedIndexChanged="GridResultadosPesquisa_SelectedIndexChanged"
                                OnDataBound="GridResultadosPesquisa_DataBound">           
             
                <PagerStyle Mode="NumericPages"
                            Position="Bottom"
                            HorizontalAlign="Left"
                            PageButtonCount="10"
                            AlwaysVisible="false"
                            ShowPagerText="true"                       
                            PrevPagesToolTip="<%$ Resources:PesquisaDocente, PrevPagesToolTip %>"
                            PrevPageToolTip="<%$ Resources:PesquisaDocente, PrevPageToolTip %>"
                            NextPagesToolTip="<%$ Resources:PesquisaDocente, NextPagesToolTip %>"
                            NextPageToolTip="<%$ Resources:PesquisaDocente, NextPageToolTip %>"
                            FirstPageToolTip="<%$ Resources:PesquisaDocente, FirstPageToolTip %>"
                            LastPageToolTip="<%$ Resources:PesquisaDocente, LastPageToolTip %>"
                            PageSizeLabelText="<%$ Resources:PesquisaDocente, PageSizeLabelText %>"
                            PagerTextFormat="<%$ Resources:PesquisaDocente, PagerTextFormat %>">
                         
                </PagerStyle>
             
                <SortingSettings SortToolTip="<%$ Resources:PesquisaDocente, SortToolTip %>"
                                    SortedAscToolTip="<%$ Resources:PesquisaDocente, SortedAscToolTip %>"
                                    SortedDescToolTip="<%$ Resources:PesquisaDocente, SortedDescToolTip %>" />
             
                <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                    <Selecting AllowRowSelect="true" />              
                </ClientSettings>                               
             
                <MasterTableView Caption="<%$ Resources:PesquisaDocente, LabelGridCaption %>"
                                    Summary="<%$ Resources:PesquisaDocente, LabelGridSummary %>"
                                    NoMasterRecordsText="<%$ Resources:PesquisaDocente, NoMasterRecordsText %>" DataKeyNames="Nome,Departamento,Categoria,Email,Gabinete,TelefoneInterno"
                                    AllowMultiColumnSorting="true" AllowCustomSorting="true" AllowNaturalSort="false">
                              
                                              
                    <Columns>
                        <telerik:GridBoundColumn
                            HeaderText="<%$ Resources:PesquisaDocente, LabelColumnDocente %>"
                            UniqueName="Nome"
                            DataField="Nome">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>
                                 
                        <telerik:GridBoundColumn
                            HeaderText="<%$ Resources:PesquisaDocente, LabelColumnUnidadeOrganicaEnsino %>"                                     
                            UniqueName="UnidadeOrganicaEnsino"
                            DataField="UnidadeOrganicaEnsino.Abreviatura">
                                <ItemStyle HorizontalAlign="Left" />
                                <HeaderStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>
 
                     
                    </Columns>
 
                </MasterTableView>           
                <SelectedItemStyle CssClass="selected-row" />
            </telerik:RadGrid>   
        </div>
        <div id="detalhes-docente" class="right-zone details-zone">
            <div class="top-zone"></div>
            <div id="DetailsZone" runat="server" class="middle-zone">
                <!-- Nome do docente -->
                <div class="details-row"><span id="NomeHolder" runat="server" class="value title"></span></div>
 
                <!-- Departamento do docente -->
                <div class="details-row">
                    <span class="label"><asp:Literal runat="server" Text="<%$ Resources:PesquisaDocente, LabelDepartamento %>" /></span>
                    <span id="DepartamentoHolder" runat="server" class="value"></span>
                </div>
 
                <!-- Categoria do docente -->
                <div class="details-row">
                    <span class="label"><asp:Literal runat="server" Text="<%$ Resources:PesquisaDocente, LabelCategoria %>" /></span>
                    <span id="CategoriaHolder" runat="server" class="value"></span>           
                </div>
 
                <!-- E-mail do docente -->
                <div class="details-row">
                    <span class="label"><asp:Literal runat="server" Text="<%$ Resources:PesquisaDocente, LabelEmail %>" /></span>
                    <span id="EmailHolder" runat="server" class="value"></span>           
                </div>
 
                <!-- Gabinete do docente -->
                <div class="details-row">
                    <span class="label"><asp:Literal runat="server" Text="<%$ Resources:PesquisaDocente, LabelGabinete %>" /></span>
                    <span id="GabineteHolder" runat="server" class="value"></span>           
                </div>
 
                <!-- Telefone interno do docente -->
                <div class="details-row">
                    <span class="label"><asp:Literal runat="server" Text="<%$ Resources:PesquisaDocente, LabelTelefoneInterno %>" /></span>
                    <span id="TelefoneInternoHolder" runat="server" class="last value"></span>           
                </div>
 
                <!-- Local do docente -->
                <!--<div class="details-row">
                    <span class="label">Local</span>
                    <span class="value">local</span>           
                </div>-->
 
                <!-- Cacifo do docente -->
                <!--<div class="details-row">
                    <span class="label">Cacifo</span>
                    <span class="value">163</span>           
                </div>-->
         
            </div>
            <div class="bottom-zone"></div>
        </div>
    </div>
</asp:Panel>
 
<div class="status-bar-zone">  
    <div class="left-side"></div>
    <div class="middle-side"></div>   
    <div class="right-side"></div>  
</div>
 
    
<telerik:RadAjaxLoadingPanel ID="WacadLoadingPanel" runat="server" Skin="Default" IsSticky="false">
 
</telerik:RadAjaxLoadingPanel>
 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="BtnPesquisar">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="AjaxPanel" LoadingPanelID="WacadLoadingPanel" />               
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="GridResultadosPesquisa">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="AjaxPanel" LoadingPanelID="WacadLoadingPanel" />              
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Please help me.
0
Ronak
Top achievements
Rank 1
answered on 01 Dec 2010, 05:25 PM
Hi Stephan
I had same problem while i was working with Visual webpart in sharepoint 2010 then what i did instead of using radajax in HTML i have created instance of it in prerender method.
Please take look at working code
[ToolboxItemAttribute(false)]
    public class NewsRollup : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/CAS.NewsRollup/NewsRollup/NewsRollupUserControl.ascx";
        RadAjaxManager ajaxmgr;
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            ajaxmgr = new RadAjaxManager();
            Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
            Page.Form.Controls.AddAt(0, ajaxmgr);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
        
        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
            Panel panel = control.FindControl("ListViewPanel1") as Panel;
            RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
            ajaxmgr.AjaxSettings.AddAjaxSetting(panel, panel, loadingPanel);
        }
    }
hope this help.
0
USI
Top achievements
Rank 1
answered on 01 Dec 2010, 06:30 PM
Thanks for the help. I will give a try.
Tags
General Discussions
Asked by
Stephan Moeller
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Stephan Moeller
Top achievements
Rank 1
USI
Top achievements
Rank 1
Ronak
Top achievements
Rank 1
Share this question
or