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

Paging not work after the first Click

1 Answer 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 17 Sep 2019, 02:17 PM

Hi Team,

 

I have a got paging enabled on a Radgrid, and this grid is in a web user control, this grid usercontrol is also in another user control.

when I drop the user control on an ASPX page, it works fine. but when I put grid usercontrol in another usercontrol, initial it was doing a postback and refreshing the whole page, but I bypassed that by add a RadAjaxManagerProxy which handled the AjaxUpdatedControl.

But my issue now, is that once I click on a paging page, it shows the paging page, but it it stops clicking and can't navigate to the rest of the paging page.

Any help would be appreciated 

Thanks in Advance.

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 20 Sep 2019, 09:52 AM

Hi Andrew,

 

Based on your description, there is most likely a JavaScript error generated by the server and is being hidden by AJAX.

Open the developer tools of the browser by pressing the "F12" key on your keyboard and monitor the Console Tab of this Tool while testing the application. If you see JavaScript errors, then that is the issue.

Make a test by turning AJAX off entirely: Get more descriptive errors by disabling AJAX. You will need to ensure that RadAjaxManager is off and there are no UpdatePanel or RadAjaxPanels on the master/content page or usercontrols. If turning AJAX will make the Grid work, then the issue is most likely caused by the Nested AJAX controls.

 

Here are some example showing the correct usage of AJAX:

 

Enable AJAX in the MasterPage

If enabling AJAX  for the loaded Content, the content and its children will be ajaxified.

MasterPage.master 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Panel1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<asp:Panel ID="Panel1" runat="server">
    <asp:ContentPlaceHolder ID="MainContent" runat="server">
        <%--Everything here will be Ajaxified, you must avoid enabling AJAX additionally for the controls in here--%>
    </asp:ContentPlaceHolder>
</asp:Panel>

 

Enable AJAX inside the Content Page 

Only the UserControl and its child controls will be ajaxified.

MasterPage.master

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>

<asp:Panel ID="Panel1" runat="server">
    <asp:ContentPlaceHolder ID="MainContent" runat="server">
        <%-- ContentPage.ASPX will be loaded here --%>
    </asp:ContentPlaceHolder>
</asp:Panel>

 

ContentPage.aspx

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Panel2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel2" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

<asp:Panel ID="Panel2" runat="server">
    <%--WebUserControl--%>
    <%-- All Controls in the WebUserControl will have AJAX enabled --%>
</asp:Panel>

 

Enable AJAX inside WebUserControl

Only one control in inside the WebUserControl will be ajaxified.

MasterPage.master

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>

<asp:Panel ID="Panel1" runat="server">
    <asp:ContentPlaceHolder ID="MainContent" runat="server">
        <%-- ContentPage.ASPX will be loaded here --%>
    </asp:ContentPlaceHolder>
</asp:Panel>

 

ContentPage.aspx

<asp:Panel ID="Panel2" runat="server">
    <%--WebUserControl--%>
</asp:Panel>

 

WebUserControl.ascx (AJAX is enabled on the innermost level of the hierarchy. Master and Content pages must not enable AJAX)

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

<telerik:RadGrid ID="RadGrid1" runat="server"></telerik:RadGrid>

 

Conclusion is that AJAX enabled controls will have its children Ajaxified. Once you ensure that AJAX is not nested, all controls will behave as expected.

 

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or