HI,
I am trying to use this code supplied in another post
however, i am getting..
Warning 2 'Public Sub New()' is obsolete: 'The recommended alternative is System.Runtime.Serialization.DataContractJsonSerializer.'.
Any ideas ?
Thanks
Mark
I am trying to use this code supplied in another post
| Protected Sub RadDockLayout1_SaveDockLayout(ByVal sender As Object, ByVal e As Telerik.Web.UI.DockLayoutEventArgs) |
| Dim dockState As String |
| Dim serializer As New Script.Serialization.JavaScriptSerializer() |
| Dim stateList As List(Of DockState) = RadDockLayout1.GetRegisteredDocksState() |
| Dim serializedList As New StringBuilder() |
| Dim i As Integer = 0 |
| While i < stateList.Count |
| serializedList.Append(serializer.Serialize(stateList(i))) |
| serializedList.Append("|") |
| i += 1 |
| End While |
| dockState = serializedList.ToString() |
| 'Save the dockState string into DB |
| End Sub |
| protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As Telerik.Web.UI.DockLayoutEventArgs) |
| Dim serializer As New Script.Serialization.JavaScriptSerializer() |
| 'Get saved state string from the database - set it to dockState variable for example |
| Dim currentDockStates As String() = dockState.Split("|") |
| For Each stringState As String In currentDockStates |
| If stringState <> String.Empty Then |
| Dim state As DockState = serializer.Deserialize(Of DockState)(stringState) |
| e.Positions(state.UniqueName) = state.DockZoneID |
| e.Indices(state.UniqueName) = state.Index |
| End If |
| Next |
| End Sub |
however, i am getting..
Warning 2 'Public Sub New()' is obsolete: 'The recommended alternative is System.Runtime.Serialization.DataContractJsonSerializer.'.
Any ideas ?
Thanks
Mark