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

RadGrid erroneously firing timeout

11 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 11 Feb 2011, 05:12 PM
The following issue occurs in Chrome 9.0.597.98 beta. I can't reproduce it in Firefox or IE. Here goes. 

So, I have the following javascript running on every page in my web app:

var TIMEOUT_DURATION = 1200000;
var timerID = null;
 
function onLogoutTimeout()
{
    $("a").each(function ()
    {
        var isLogoutLink = jQuery(this).attr("id").toString().search(new RegExp(/signoutLink/i));
        if (isLogoutLink >= 0)
            document.location = this.href;
    });
}
 
function onResetTimer()
{
    clearTimeout(timerID);
    timerID = setTimeout("onLogoutTimeout()", TIMEOUT_DURATION);
}
 
$(document).ready(function ()
{
    timerID = setTimeout("onLogoutTimeout()", TIMEOUT_DURATION);
 
    $(this).mousemove(function (e) { onResetTimer() });
    $(this).keydown(function (e) { onResetTimer() });
});

Basically, it sets a timeout so that if a user is idle for to long, it will log them out. You'll notice that I'm using jQuery. I'm using the jQuery that comes packages with the Telerik controls. I'm using 2010.3.1317.40. The following is a simple page with a RadGrid on it:

<%@ Page Title="" Language="C#" MasterPageFile="~/Includes/MasterPages/GofrPortalMasterPage.master"
    AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Organization_Admin_Users_Default"
    Culture="auto" UICulture="auto" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageTitle" runat="Server">
    <asp:Localize runat="server" meta:resourcekey="PageTitle"></asp:Localize>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadCodeBlock ID="rcbCodeBlock" runat="server">
        <script type="text/javascript">
            if (typeof SubscribeToWindowClose == "function")
            {
                SubscribeToWindowClose("rwCreateUser", OnCreateUserWindowClose);
                SubscribeToWindowClose("rwEditUser", OnCreateUserWindowClose);
            }
 
            function OnCreateUserWindowClose(args)
            {
                var userGridAjaxPanel = $find("<%= rapUserGrid.ClientID %>");
                userGridAjaxPanel.ajaxRequest("Rebind");
            }
        </script>
    </telerik:RadCodeBlock>
    You can add users by clicking on the plus icon or modify them by clicking on their
    email address.<br />
    <br />
    <telerik:RadAjaxPanel ID="rapUserGrid" runat="server" OnAjaxRequest="OnUserGridAjaxRequest"
        LoadingPanelID="loadingPanel">
        <telerik:RadGrid ID="rgUser" runat="server" EnableEmbeddedSkins="False" Skin="GofrDefault"
            GridLines="None" AutoGenerateColumns="False" OnItemDeleted="OnItemDeleted" OnNeedDataSource="OnNeedUsersDataSource"
            OnDeleteCommand="OnDeleteUser" AllowSorting="true">
            <MasterTableView DataKeyNames="AssetID" CommandItemDisplay="Top" meta:resourcekey="GridMasterTableView">
                <Columns>
                    <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmText="Are you sure you want to delete this user?"
                        ConfirmTitle="Confirm Delete" UniqueName="DeleteColumn" CommandName="Delete" ImageUrl="~/Skins/GofrDefault/Grid/Delete.gif"
                        ItemStyle-Width="1em" meta:resourcekey="UserGridDeleteColumn">
                    </telerik:GridButtonColumn>
                    <telerik:GridHyperLinkColumn HeaderText="Email Address" SortExpression="EmailAddress"
                        ItemStyle-Width="30em" DataTextField="EmailAddress" DataNavigateUrlFields="AssetID"
                        DataNavigateUrlFormatString="javascript:OpenRadWindow_NoReturn('rwEditUser', {{'UserID':{0}}})"
                        meta:resourcekey="UserGridEmailColumn">
                    </telerik:GridHyperLinkColumn>
                    <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" SortExpression="FirstName"
                        meta:resourcekey="UserGridFirstNameColumn">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" SortExpression="LastName"
                        meta:resourcekey="UserGridLastNameColumn">
                    </telerik:GridBoundColumn>
                </Columns>
                <CommandItemTemplate>
                    <div class="gridCommandItemDiv">
                        <asp:HyperLink runat="server" CssClass="gridCommandItem" Text="<%$ Resources:VirtualOfficeResources, CreateUserLabel %>"
                            NavigateUrl="javascript:OpenRadWindow_NoReturn('rwCreateUser', null, null)" ImageUrl="~/Skins/GofrDefault/Grid/AddRecord.gif"
                            ToolTip="Create User"></asp:HyperLink>
                    </div>
                </CommandItemTemplate>
            </MasterTableView>
            <FilterMenu EnableEmbeddedSkins="False">
            </FilterMenu>
            <HeaderContextMenu EnableEmbeddedSkins="False">
            </HeaderContextMenu>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="loadingPanel" runat="server" Transparency="0" IsSticky="true">
        <asp:Panel ID="innerLoadingPanel" runat="server" CssClass="innerLoadingPanel">
            <table>
                <tr>
                    <td>
                        <asp:Image runat="server" ImageUrl="~/Skins/GofrDefault/Common/loading.gif" />
                    </td>
                    <td style="color: White; padding-left: 1em; font-size: larger">
                        <asp:Localize runat="server" Text="<%$ Resources:VirtualOfficeResources, LoadingLabel %>"></asp:Localize>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <ajax:AlwaysVisibleControlExtender runat="server" HorizontalSide="Center" VerticalSide="Middle"
            VerticalOffset="150" HorizontalOffset="100" TargetControlID="innerLoadingPanel">
        </ajax:AlwaysVisibleControlExtender>
    </telerik:RadAjaxLoadingPanel>
</asp:Content>

So basically what is happening is that when I push the delete button next to a user, it is firing the onLogoutTimeout() javascript timeout. The confirm dialog comes up, on confirm the server side event gets fired, and then this timeout event gets fired, which logs a user out. Not sure why this is happening. Any help would be appreciated.

11 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 16 Feb 2011, 05:23 PM
Hello Chris,

Could you try the following set-up: add a link button on the page outside the grid. Click it and see if the same behavior aspires. Looking forward to your feedback.

Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Chris
Top achievements
Rank 1
answered on 17 Feb 2011, 04:43 PM
Okay, did that and the behavior did not show up.
0
Tsvetoslav
Telerik team
answered on 22 Feb 2011, 04:16 PM
Hi Chris,

Thanks for confirming that the problem is not reproduced outside of RadGrid.

Please, isolate the problem into a small runnable sample, open up a formal support ticket and send it to us for debugging as from the pasted code it cannot be ascertained what sequence of client-side events (not user actions) leads to the issue discussed.

Thanks for that.

Regards,
Tsvetoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Chris
Top achievements
Rank 1
answered on 28 Feb 2011, 07:25 PM
I have been unable to reproduce it in a smaller project. If you want, I would be more than happy to setup a GoToMeeting or something to show you guys if you are interested.
0
Tsvetoslav
Telerik team
answered on 02 Mar 2011, 11:27 AM
Hello Chris,

Is it then possible to send your project with the necessary files to run it on our side?

Best wishes,
Tsvetoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Chris
Top achievements
Rank 1
answered on 02 Mar 2011, 03:56 PM
No, it has intellectual property in it.
0
Chris
Top achievements
Rank 1
answered on 03 Mar 2011, 06:26 PM
Ok, I spent a little more time at it and was able to successfully create a small project to duplicate the problem I'm seeing. You can find it at http://telerik.ourdoings.org. 

Username: telerikuser
Password: Password!

This is just a test project to show it. Nothing sensitive. I'd be more than happy to send the project to you. The project might be a chore to setup since it is using Windows Identity Foundation and Active Directory Federation Services.

Notice that this problem only occurs in Chrome and only on delete. Let me know if you need anything else to help you.
0
Tsvetoslav
Telerik team
answered on 07 Mar 2011, 04:37 PM
Hello Chris,

Thanks for that. I did observe the problem and as faar as Chrome's developer tool allowed me, managed to ascertain that this issue actually occurs on any input on the page, as long as that one has a confirm dialogue. What is did is change the dom element for the add new item button by inserting a confirm dialogues into its onclick event - the result was the same: user logged out. Then I added into the dom tree a simple input outside the grid with a confirm dialogue on its onclick event and the effect was once again a redirect to the log-in page. I am not sure why this is happening but would appreciate sending the code for the sample - I will try to adapt it to run on my side.

Thaks.

Regards,
Tsvetoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Chris
Top achievements
Rank 1
answered on 08 Mar 2011, 04:35 PM
What's the best way to send the code? I can't attach a zip to this thread.
0
Tsvetoslav
Telerik team
answered on 09 Mar 2011, 03:22 PM
Hello Chris,

Sorry for having missed to point this out - you should open a support ticket (which is different from a forum thread) - this will allow you to send attachments.

Best wishes,
Tsvetoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Themba
Top achievements
Rank 1
answered on 13 Feb 2017, 06:38 AM

I am having the same issue with the . On my observation, i have noticed that this occurs when the dataset query contains conditional if statements or union. NB: This does not happen every time the query is executed, sometimes in runs fine without any error.

 

Thanks 

Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Chris
Top achievements
Rank 1
Themba
Top achievements
Rank 1
Share this question
or