<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>---</
title
>
<
link
type
=
"text/css"
rel
=
"Stylesheet"
href
=
"Resources/Style.css"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadPanelBar"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"PH"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadToolBar"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadToolBar"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadToolBar"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"PH"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager"
runat
=
"server"
>
</
telerik:RadStyleSheetManager
>
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator"
runat
=
"server"
/>
<
div
style
=
"width:100%;height:40px;"
>
<
div
style
=
"float:right;margin-right:10px;"
>
<
asp:Label
runat
=
"server"
ID
=
"L_Operator"
></
asp:Label
><
br
/>
<
asp:LinkButton
runat
=
"server"
ID
=
"LB_LogOut"
Text
=
"LogOut"
></
asp:LinkButton
>
</
div
>
</
div
>
<
telerik:RadSplitter
ID
=
"RadSplitter_Frame"
runat
=
"server"
Width
=
"100%"
Height
=
"100%"
Orientation
=
"Vertical"
HeightOffset
=
"40"
>
<
telerik:RadPane
ID
=
"RadPane_Frame_Left"
runat
=
"server"
Width
=
"200px"
Height
=
"100%"
>
<
telerik:RadPanelBar
ID
=
"RadPanelBar"
runat
=
"server"
Width
=
"100%"
ExpandMode
=
"MultipleExpandedItems"
>
</
telerik:RadPanelBar
>
</
telerik:RadPane
>
<
telerik:RadPane
ID
=
"RadPane_Frame_Right"
runat
=
"server"
Width
=
"100%"
Height
=
"100%"
Scrolling
=
"None"
>
<
telerik:RadSplitter
runat
=
"server"
ID
=
"RadSplitter_Body"
Width
=
"100%"
Height
=
"100%"
Orientation
=
"Horizontal"
>
<
telerik:RadPane
runat
=
"server"
ID
=
"RadPane_Body_Top"
Width
=
"100%"
Height
=
"38px"
>
<
telerik:RadToolBar
runat
=
"server"
ID
=
"RadToolBar"
Width
=
"100%"
>
</
telerik:RadToolBar
>
</
telerik:RadPane
>
<
telerik:RadPane
runat
=
"server"
ID
=
"RadPane_Body_Bottom"
Width
=
"100%"
Height
=
"100%"
>
<
asp:PlaceHolder
runat
=
"server"
ID
=
"PH"
></
asp:PlaceHolder
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
form
>
</
body
>
</
html
>
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Operators.ascx.vb" Inherits="System_Operators" %>
<
telerik:RadSplitter
runat
=
"server"
ID
=
"RadSplitter_Frame"
Width
=
"100%"
Height
=
"100%"
Orientation
=
"Horizontal"
>
<
telerik:RadPane
runat
=
"server"
ID
=
"RadPane_Top"
Width
=
"100%"
Height
=
"26px"
>
OPERATORS
</
telerik:RadPane
>
<
telerik:RadPane
runat
=
"server"
ID
=
"RadPane_Body"
Width
=
"100%"
Height
=
"100%"
>
<
telerik:RadGrid
ID
=
"RadGrid"
runat
=
"server"
AllowSorting
=
"True"
GridLines
=
"None"
Width
=
"100%"
Height
=
"100%"
AllowMultiRowSelection
=
"True"
AllowPaging
=
"True"
PageSize
=
"50"
AutoGenerateColumns
=
"false"
ShowStatusBar
=
"True"
style
=
"border:0px;outline:none;"
>
<
GroupingSettings
CaseSensitive
=
"False"
/>
<
ExportSettings
ExportOnlyData
=
"True"
OpenInNewWindow
=
"True"
/>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowContextMenu
=
""
OnRowDblClick
=
""
/>
<
Scrolling
AllowScroll
=
"True"
ScrollHeight
=
"100%"
UseStaticHeaders
=
"True"
/>
<
Resizing
AllowColumnResize
=
"True"
/>
</
ClientSettings
>
<
PagerStyle
AlwaysVisible
=
"true"
/>
<
MasterTableView
OverrideDataSourceControlSorting
=
"True"
style
=
"border:0px;outline:none;"
>
<
NoRecordsTemplate
>
</
NoRecordsTemplate
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Name"
HeaderText
=
"Nome"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Surname"
HeaderText
=
"Cognome"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"User"
HeaderText
=
"Utente"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Ruolo"
HeaderText
=
"Ruolo"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
This affects lots of ajax functionality, but for this example, I'll use the ajax spell checker in the radeditor. I had some users complain that the spell checker seemed to 'freak out' every now and then, and I traced it to this.
To reproduce, use forms authentication with a login URL and a short timeout of 1, (just so you don't have to wait long for this test).
<authentication mode="Forms"> |
<forms name=".userauth" loginUrl="IC/Login.aspx" protection="All" timeout="1"/> |
</authentication> |
Wait at least a minute then click on spell check. You should get this JavaScript error:
Microsoft JScript runtime error: Sys.ArgumentException: Cannot deserialize. The data does not correspond to valid JSON.
Parameter name: data
This happens because the forms auth. timed out and the ajax request was redirected to the login page. The login page is HTML and not JSON, so MS ajax throws the above error. The spell checker is left onscreen and cannot be closed as both Finish and Cancel are disabled.
My question is: is there anything that can be done for this, like catching the error somehow, and throwing up a login dialog?
What I have done in the past is ping the server every 10 minutes with JavaScript to keep formsauth. alive. I'd like to avoid that technique if possible as it didn't seem to be reliable all the time, and it left users logged in too long.
Thanks