I have a radDockLayout which somehow has the e.Positions being empty.
The problem is ... somehow, when i click on the save button, and breakpointing into //my codes, the e.Positions and Indices have empty content. That's really weird. Am I missing something?
| <telerik:RadDockLayout runat="server" ID="RadDockLayout1" OnLoadDockLayout="RadDockLayout1_LoadDockLayout" onsavedocklayout="RadDockLayout1_SaveDockLayout" storelayoutinviewstate="false"> |
| <div class="signature"> |
| <asp:Panel ID="pnlPreview" runat="server" CssClass="zones"></asp:Panel> |
| <br /><br /><asp:Button ID="btnSave" runat="server" Text="Save Layout" /> |
| </div> |
| <div class="preview"> |
| <asp:Repeater ID="rptContentType" runat="server" OnItemDataBound="rptContentType_OnItemDataBound"> |
| <HeaderTemplate><ul id="contentlibrary"></HeaderTemplate> |
| <ItemTemplate> |
| <li> |
| <h2> |
| <span class="title"><%#DataBinder.Eval(Container.DataItem,"Title") %></span> |
| <asp:Image ID="imgIcon" runat="server" CssClass="icon" /></h2> |
| <telerik:RadDockZone id="radDockZone" runat="server" Height="150"></telerik:RadDockZone> |
| <asp:Repeater ID="rptContentLibrary" runat="server" OnItemDataBound="rptContentLibrary_OnItemDataBound"></asp:Repeater> |
| </li> |
| </ItemTemplate> |
| <FooterTemplate></ul></FooterTemplate> |
| </asp:Repeater> |
| </div> |
| </telerik:RadDockLayout> |
| protected void RadDockLayout1_LoadDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) |
| { |
| HttpCookie positionsCookie = Request.Cookies[Request["id"] + "CompanyEmailLayout"]; |
| if (!Object.Equals(positionsCookie, null)) |
| { |
| string serializedPositionsAndIndices = positionsCookie.Value; |
| if (!string.IsNullOrEmpty(serializedPositionsAndIndices)) |
| { |
| JavaScriptSerializer serializer = new JavaScriptSerializer(); |
| string[] positionsAndIndices = serializer.Deserialize<string[]>(serializedPositionsAndIndices); |
| e.Positions = serializer.Deserialize<Dictionary<string, string>>(positionsAndIndices[0]); |
| e.Indices = serializer.Deserialize<Dictionary<string, int>>(positionsAndIndices[1]); |
| } |
| } |
| } |
| protected void RadDockLayout1_SaveDockLayout(object sender, Telerik.Web.UI.DockLayoutEventArgs e) |
| { |
| JavaScriptSerializer serializer = new JavaScriptSerializer(); |
| string serializedPositions = serializer.Serialize(e.Positions); |
| string serializedIndices = serializer.Serialize(e.Indices); |
| HttpCookie positionsCookie = new HttpCookie(Request["id"] + "CompanyEmailLayout", |
| serializer.Serialize(new string[] { serializedPositions, serializedIndices })); |
| //Ensure that the cookie will not expire soon |
| positionsCookie.Expires = DateTime.Now.AddYears(1); |
| Response.Cookies.Add(positionsCookie); |
| if (IsPostBack) |
| { |
| //my codes |
| } |
| } |
The problem is ... somehow, when i click on the save button, and breakpointing into //my codes, the e.Positions and Indices have empty content. That's really weird. Am I missing something?