Please help me to fix the following error:
Using: Microsoft Visual Studio Ultimate 2012, UI for ASP.NET AJAX Q1 2015
Server Error in '/SmartTrace' Application.Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.
Source Error:
Line 47: for (int i = 0; i < states.Length; i++)
Line 48: {
Line 49: DockState state = DockState.Deserialize(states[i]);
Line 50: e.Positions[state.UniqueName] = state.DockZoneID;
Line 51: e.Indices[state.UniqueName] = state.Index;
Source File: d:\Projects\SmartTrace\Dashboard3.aspx.cs Line: 49
Server Error in '/SmartTrace' Application.Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.
Source Error:
Line 47: for (int i = 0; i < states.Length; i++)
Line 48: {
Line 49: DockState state = DockState.Deserialize(states[i]);
Line 50: e.Positions[state.UniqueName] = state.DockZoneID;
Line 51: e.Indices[state.UniqueName] = state.Index;
Source File: d:\Projects\SmartTrace\Dashboard3.aspx.cs Line: 49
:
Server Error in '/Website1' Application.
Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid JSON primitive: **{"DockZoneID":"RadDockZone2","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock2","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***{"DockZoneID":"RadDockZone3","Width":{"Type":1,"Value":300,"IsEmpty":false},"ExpandedHeight":0,"Height":{"Type":1,"Value":0,"IsEmpty":true},"Index":0,"Top":{"Type":1,"Value":0,"IsEmpty":false},"Left":{"Type":1,"Value":0,"IsEmpty":false},"Closed":false,"Resizable":false,"Collapsed":false,"Pinned":false,"UniqueName":"RadDock3","Tag":null,"Title":"","Text":"","ControlSettings":[],"UniqueId":null,"UniqueKey":null}***.
Source Error:
Line 47: for (int i = 0; i < states.Length; i++)
Line 48: {
Line 49: DockState state = DockState.Deserialize(states[i]);
Line 50: e.Positions[state.UniqueName] = state.DockZoneID;
Line 51: e.Indices[state.UniqueName] = state.Index;
Source File: d:\Projects\SmartTrace\Dashboard3.aspx.cs Line: 49
ASPX Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dashboard3.aspx.cs" Inherits="Dashboard3" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
div
>
<
telerik:RadDockLayout
ID
=
"RadDockLayout1"
runat
=
"server"
OnSaveDockLayout
=
"RadDockLayout1_SaveDockLayout"
OnLoadDockLayout
=
"RadDockLayout1_LoadDockLayout"
EnableViewState
=
"False"
StoreLayoutInViewState
=
"True"
>
<
telerik:RadDockZone
ID
=
"RadDockZone1"
runat
=
"server"
Height
=
"300px"
Width
=
"300px"
>
<
telerik:RadDock
ID
=
"RadDock1"
runat
=
"server"
Width
=
"300px"
Title
=
"Dock 1"
>
<
ContentTemplate
>
content 1
</
ContentTemplate
>
</
telerik:RadDock
>
<
telerik:RadDock
ID
=
"RadDock2"
runat
=
"server"
Width
=
"300px"
Title
=
"Dock 2"
>
<
ContentTemplate
>
content 2
</
ContentTemplate
>
</
telerik:RadDock
>
</
telerik:RadDockZone
>
</
telerik:RadDockLayout
>
</
div
>
</
form
>
</
body
>
</
html
>
C# Code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
public
partial
class
Dashboard3 : System.Web.UI.Page
{
protected
void
Page_Init(
object
sender, EventArgs e)
{
//RadDockLayout1.Controls.Add(RadDockZone1);
//RadDockLayout1.Controls.Add(RadDockZone2);
//RadDockLayout1.Controls.Add(RadDockZone3);
//RadDockLayout1.Controls.Add(RadDock1);
//RadDockLayout1.Controls.Add(RadDock2);
//RadDockLayout1.Controls.Add(RadDock3);
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
}
protected
void
RadDockLayout1_SaveDockLayout(
object
sender, Telerik.Web.UI.DockLayoutEventArgs e)
{
HttpCookie dockState = Page.Response.Cookies.Get(
"DashboardDockStates"
);
if
(dockState ==
null
)
{
dockState =
new
HttpCookie(
"DashboardDockStates"
);
Page.Response.Cookies.Add(dockState);
}
List<DockState> stateList = ((RadDockLayout)sender).GetRegisteredDocksState();
StringBuilder serializedList =
new
StringBuilder();
for
(
int
i = 0; i < stateList.Count; i++)
{
serializedList.Append(stateList[i].ToString());
serializedList.Append(
"|"
);
}
dockState.Expires = DateTime.Today.AddMonths(1);
dockState.Value = serializedList.ToString();
}
protected
void
RadDockLayout1_LoadDockLayout(
object
sender, DockLayoutEventArgs e)
{
HttpCookie dockState = Page.Request.Cookies.Get(
"DashboardDockStates"
);
if
(dockState !=
null
)
{
string
serializedList = dockState.Value;
if
(serializedList !=
null
)
{
string
[] states = serializedList.Split(
'|'
);
for
(
int
i = 0; i < states.Length; i++)
{
DockState state = DockState.Deserialize(states[i]);
e.Positions[state.UniqueName] = state.DockZoneID;
e.Indices[state.UniqueName] = state.Index;
}
}
}
}
}
<
telerik:RadGrid
ID
=
"rgRequests"
runat
=
"server"
Skin
=
"Metro"
OnItemCreated
=
"rgRequests_ItemCreated"
OnUpdateCommand
=
"rgRequests_UpdateCommand"
OnNeedDataSource
=
"rgRequests_NeedDataSource"
AllowMultiRowEdit
=
"true"
MasterTableView-EditMode
=
"Batch"
MasterTableView-ClientDataKeyNames
=
"DPO,DLINE,DQTY,DRQTY"
AutoGenerateColumns
=
"false"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemSettings-ShowRefreshButton
=
"true"
CommandItemSettings-ShowSaveChangesButton
=
"true"
CommandItemSettings-ShowCancelChangesButton
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"PO#"
DataField
=
"DPO"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
HeaderText
=
"LINE"
DataField
=
"DLINE"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Item"
DataField
=
"DITEM"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Ordered"
DataField
=
"DQTY"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Received"
DataField
=
"DRQTY"
ReadOnly
=
"true"
/>
<
telerik:GridNumericColumn
HeaderText
=
"Received Today"
DataField
=
"CDRQTY"
ColumnEditorID
=
"CDRQTY"
DataType
=
"System.Int32"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
hi
I need use session in ResourceStyleMapping Scheduler
I use below code but don't work correctly :
<ResourceStyles>
<telerik:ResourceStyleMapping Type=
"User"
Key=
'<%= Session["user_Id"] %>'
BackColor=
"Aqua"
></telerik:ResourceStyleMapping>
<telerik:ResourceStyleMapping Type=
"User"
Key=
"1"
BackColor=
"Aqua"
></telerik:ResourceStyleMapping>
</ResourceStyles>
please help me.
When I run the page without the Rebind() method call in my PreRender() method I get the desired filtering behavior, for the most part. We want the ComboBoxes to have a cascading data feature. When I set AppendDataBoundItems=”false” this does the trick but the user can no longer set the ComboBox to “ALL”. I put in a button to clear all the filters and that isn’t too bad. The problem I am running into now is when I have the ComboBoxes set and type in a first or last name that is invalid the page does nothing but says there is an error. I went to http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx and when you set the country to Argentina then set the filter for Is Promoted to yes the page loads http://demos.telerik.com/ErrorPageResources/error.aspx?aspxerrorpath=/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx this error. I thought that it was just a random connection but apparently your filters have the same issue that I am trying to overcome. I am guessing that you guys are aware of this issue, are there any suggestions on something that could be done? Or am I limited to trying to make the possibility of this happening as small as possible?
I also would like to have the ComboBoxes show all values that are on the same level as the current selection. For an example if it was States and Cities, and I had selected California for the state and Los Angeles for the City, I would like to click on the city combobox and have it display all cities in the state of California. Where would be a place to start looking for that possibility?
I thought maybe it would help to include a little more information from a prior question that this issue pertains to:
======================================================================================================
Posted on Nov 23, 2010 (permalink)
Posted on Nov 23, 2010 (permalink)
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"SqlDataSource1"
DataKeyNames
=
"USER_ID"
AllowMultiColumnSorting
=
"true"
Width
=
"100%"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Skin
=
"Outlook"
PageSize
=
"100"
EnableLinqExpressions
=
"False"
ShowGroupPanel
=
"True"
ShowStatusBar
=
"True"
AutoGenerateColumns
=
"false"
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
AllowDragToGroup
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
Protected Sub RadGrid1_PreRender(ByVal o As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
If Not RadGrid1.MasterTableView.FilterExpression Is String.Empty Then
FilterSetter()
End If
End Sub
Private Sub FilterSetter()
sqlLocationFilter.SelectCommand = "SELECT DISTINCT [DBOL] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [Location]"
sqlDepartmentFilter.SelectCommand = "SELECT DISTINCT [DOBD] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [DBOD]"
sqlOfficeFilter.SelectCommand = "SELECT DISTINCT [DBOO] FROM [DBO]" & " WHERE " & RadGrid1.MasterTableView.FilterExpression.ToString() & " ORDER BY [DBOO]"
RadGrid1.MasterTableView.Rebind()
End Sub
Protected Sub ResetFiltersButton_OnClick(ByVal o As Object, ByVal e As EventArgs)
RadGrid1.MasterTableView.FilterExpression = String.Empty
For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns
If TypeOf column Is GridBoundColumn Then
Dim boundColumn As GridBoundColumn = TryCast(column, GridBoundColumn)
boundColumn.CurrentFilterValue = String.Empty
End If
Next
RadGrid1.Rebind()
End Sub
Protected Sub RadGrid1_ItemCommand(ByVal o As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand
If e.CommandName = Telerik.Web.UI.RadGrid.ExpandCollapseCommandName Then
Dim item As GridItem
For Each item In e.Item.OwnerTableView.Items
TestExpandEvent.Visible = True
If item.Expanded And item IsNot e.Item Then
item.Expanded = False
End If
Next
End If
End Sub
End Class
Posted on Nov 24, 2010 (permalink)
Protected
Sub
RadGrid1_PreRender(
ByVal
o
As
Object
,
ByVal
e
As
EventArgs)
Handles
RadGrid1.PreRender
If
Not
RadGrid1.MasterTableView.FilterExpression
Is
String
.Empty
Then
FilterSetter()
End
If
End
Sub
Private
Sub
FilterSetter()
SqlLocationFilter.SelectCommand =
"SELECT DISTINCT [Location] FROM [View_PhoneList_Debra] "
&
"WHERE "
& RadGrid1.MasterTableView.FilterExpression.ToString() &
" ORDER BY [Location]"
SqlDepartmentFilter.SelectCommand =
"SELECT DISTINCT [Department] FROM [View_PhoneList_Debra] "
&
"WHERE "
& RadGrid1.MasterTableView.FilterExpression.ToString() &
" ORDER BY [Department]"
RadGrid1.MasterTableView.Rebind()
End
Sub
Protected
Sub
RadGrid1_ItemCommand(
ByVal
o
As
Object
,
ByVal
e
As
GridCommandEventArgs)
Handles
RadGrid1.ItemCommand
If
e.CommandName = Telerik.Web.UI.RadGrid.ExpandCollapseCommandName
Then
Dim
item
As
GridItem
For
Each
item
In
e.Item.OwnerTableView.Items
If
item.Expanded
And
item IsNot e.Item
Then
item.Expanded =
False
End
If
Next
End
If
End
Sub
Posted on Nov 26, 2010 (permalink)
FilterSetter
(). At this point, your expanded item is gone, because the grid items are recreated.Posted 1 day ago (permalink)
When I run the page without the Rebind() method call in my PreRender() method I get the desired filtering behavior, for the most part. We want the ComboBoxes to have a cascading data feature. When I set AppendDataBoundItems=”false” this does the trick but the user can no longer set the ComboBox to “ALL”. I put in a button to clear all the filters and that isn’t too bad. The problem I am running into now is when I have the ComboBoxes set and type in a first or last name that is invalid the page does nothing but says there is an error. I went to http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx and when you set the country to Argentina then set the filter for Is Promoted to yes the page loads http://demos.telerik.com/ErrorPageResources/error.aspx?aspxerrorpath=/aspnet-ajax/grid/examples/programming/filtertemplate/defaultvb.aspx this error. I thought that it was just a random connection but apparently your filters have the same issue that I am trying to overcome. I am guessing that you guys are aware of this issue, are there any suggestions on something that could be done? Or am I limited to trying to make the possibility of this happening as small as possible?
I also would like to have the ComboBoxes show all values that are on the same level as the current selection. For an example if it was States and Cities, and I had selected California for the state and Los Angeles for the City, I would like to click on the city combobox and have it display all cities in the state of California. Where would be a place to start looking for that possibility?