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

Radgrid/WebResource JS Exceptions

3 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 22 Dec 2020, 05:54 PM
I have a very simple ASP.net web form with a couple of data pickers, a button and a radGrid. When I initially load the page the grid is not populated and is dependant on both date pickers having selected values. When I click the "Refresh" button to set the radGrid datasource (the result of a stored procedure with two parameters), I noticed that none of the grid filters worked. Upon further investigation I see that there are a couple of uncaught errors (see the attached image).

I am using version 2020.3.1021 of the ASP.net controls so there isn't any outstanding updates. Other grids work as expected.

Can you advise?

3 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 24 Dec 2020, 04:06 PM

Hello Ian,

Unfortunately, the information is insufficient for us to determine right away what is causing it. Can you please share the whole page setup and code behind? 

In the meantime, please ensure that there are no elements that are inside an AjaxPanel/Update panel and added to the RadAjaxManager settings at the same time.

Also, you can try disabling the AJAX temporarily and see if the issue persists:

Regards,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Ian
Top achievements
Rank 1
answered on 29 Dec 2020, 06:22 PM

Here is the page ASP code. The JS error gets triggered as soon as the "FilterDates" button gets fired.

 

Let me know if you need anything else.

 

<%@ Page Title="Monitor EDU" Language="vb" AutoEventWireup="false" MasterPageFile="~/admin.Master" CodeBehind="Manage.aspx.vb" Inherits="FLSC_CE.Components.monitoredu.Manage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="Panel1" runat="server">
        <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
                (function (i, s, o, g, r, a, m) {
                    i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
                        (i[r].q = i[r].q || []).push(arguments);
                    }, i[r].l = 1 * new Date(); a = s.createElement(o),
                        m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);
                })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

                ga('create', 'UA-57709725-1', 'auto');
                ga('send', 'pageview');

                function pageLoad() {
                    $('#SessionDate_dateInput').val("Start Date");
                    $('#SessionEndDate_dateInput').val("End Date");
                }

            </script>
        </telerik:RadCodeBlock>
        <%--<telerik:RadAjaxPanel runat="server" ID="AjaxPanel" PostBackControls="MonitorExport"></telerik:RadAjaxPanel>--%>
        <div id="divSuccess" runat="server" class="alert alert-success alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            Your action was successful.
        </div>
        <div id="divWarning" runat="server" class="alert alert-warning alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        </div>
        <div id="divException" runat="server" class="alert alert-danger alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <strong>Warning!</strong> The action was not successful.
        </div>
        <div id="divInfo" runat="server" class="alert alert-info alert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <strong>Information</strong> This is information
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Retrieve from CE and Export to MonitorEDU 
                </strong>
            </div>
            <div class="panel panel-body">
                <p>
                    Select session Start and End dates<br />
                    <telerik:RadDatePicker ID="SessionDate" runat="server">
                        <Calendar runat="server"> 
                            <SpecialDays> 
                                <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="#6CD900"> 
                                </telerik:RadCalendarDay> 
                            </SpecialDays> 
                        </Calendar>
                    </telerik:RadDatePicker>
                    <telerik:RadDatePicker ID="SessionEndDate" runat="server">
                        <Calendar runat="server"> 
                            <SpecialDays> 
                                <telerik:RadCalendarDay Repeatable="Today" ItemStyle-BackColor="#6CD900"> 
                                </telerik:RadCalendarDay> 
                            </SpecialDays> 
                        </Calendar>
                    </telerik:RadDatePicker>
                    <asp:Button runat="server" ID="FilterDates" Text="Apply"/>
                    <asp:RequiredFieldValidator id="RequiredSessionDate" ControlToValidate="SessionDate" Display="Static" ErrorMessage="Start date required. " runat="server" ForeColor="Red"/>
                    <asp:RequiredFieldValidator id="RequiredSessionEndDate" ControlToValidate="SessionEndDate" Display="Static" ErrorMessage="End date required. " runat="server" ForeColor="Red"/>
                </p>
                <telerik:RadGrid ID="MonitorExport" runat="server" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="False" EnableHeaderContextMenu="True" ShowFooter="True" PageSize="100" Height="550px" AllowMultiRowSelection="False" AutoGenerateColumns="False" Width="1400px">
                    <ExportSettings ExportOnlyData="True" IgnorePaging="True">
                    </ExportSettings>
                    <ClientSettings AllowDragToGroup="False" ReorderColumnsOnClient="True">
                        <Selecting AllowRowSelect="True" />
                        <KeyboardNavigationSettings AllowActiveRowCycle="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />
                        <Resizing AllowColumnResize="True" />
                    </ClientSettings>
                    <MasterTableView AutoGenerateColumns="False" AllowCustomPaging="False" DataKeyNames="NCA, RegistrationID, LastName, FirstName" CommandItemDisplay="Top" NoDetailRecordsText="No information is available" NoMasterRecordsText="No master information is available">
                        <CommandItemSettings ShowCancelChangesButton="False" ShowExportToCsvButton="True" ShowExportToExcelButton="True" ShowSaveChangesButton="False" ShowAddNewRecordButton="False" ShowPrintButton="false" />
                        <Columns>
                            <telerik:GridBoundColumn DataField="NCA" HeaderText="NCA" Visible="True" EnableHeaderContextMenu="True" UniqueName="NCA" Groupable="False">
                                <HeaderStyle Width="80px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="80px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="RegistrationID" HeaderText="Registration ID" Visible="True" EnableHeaderContextMenu="True" UniqueName="RegistrationID" Groupable="False">
                                <HeaderStyle Width="80px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="80px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" Visible="True" EnableHeaderContextMenu="True" UniqueName="Email" Groupable="False">
                                <HeaderStyle Width="150px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="150px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" Visible="True" EnableHeaderContextMenu="True" UniqueName="FirstName" Groupable="False">
                                <HeaderStyle Width="150px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="150px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" Visible="True" EnableHeaderContextMenu="True" UniqueName="LastName" Groupable="False">
                                <HeaderStyle Width="150px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="150px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Exam" HeaderText="Exam" Visible="True" EnableHeaderContextMenu="True" UniqueName="Exam" Groupable="False">
                                <HeaderStyle Width="600px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="600px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn DataField="SessionDateTime" HeaderText="Session Date" Display="True" DataFormatString="{0:D}" EnableRangeFiltering="true" SortExpression="SessionDateTime" UniqueName="SessionDateTime" Groupable="False" PickerType="DatePicker" EnableHeaderContextMenu="True">
                                <HeaderStyle Width="80px" VerticalAlign="Top"></HeaderStyle>
                                <ItemStyle VerticalAlign="Top" Width="80px"></ItemStyle>
                            </telerik:GridDateTimeColumn>
                            <telerik:GridBoundColumn DataField="RequestedTimeSlot" HeaderText="Requested Time" Visible="True" EnableHeaderContextMenu="True" UniqueName="RequestedTimeSlot" Groupable="False">
                                <HeaderStyle Width="80px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="80px"></ItemStyle>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EDUAssigned" HeaderText="Assigned Time" Visible="True" EnableHeaderContextMenu="True" UniqueName="EDUAssigned" Groupable="False">
                                <HeaderStyle Width="150px" VerticalAlign="Top" />
                                <ItemStyle VerticalAlign="Top" Width="150px"></ItemStyle>
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </div>
        </div>
    </asp:Panel>
</asp:Content>

0
Peter Milchev
Telerik team
answered on 04 Jan 2021, 10:14 AM

Hello Ian,

I have isolated the shared snippet in a working project and shared it here. As you can see, there is no error observed. 

Please modify the attached project and share the modified aspx files so we can investigate further the issue. Additionally, you can share the whole MasterPage and the code behind files for the page and the MasterPage. You can open an official support thread where you can attach them if they contain any sensitive information that should not be in the public forums.

In the meantime, you can check if temporarily disabling the AJAX would resolve the issue:

Also, please ensure that no element is AJAX-enabled by both an UpdatePanel/AjaxPanel and RadAjaxManager settings at the same time, or you have an UpdatePanel/AjaxPanel wrapping another UpdatePanel/AjaxPanel.

Regards,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Ian
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Ian
Top achievements
Rank 1
Share this question
or