Hi,
I'm getting the folllowing error when adding a RadDock control to a RadDockZone in Page_Init.
What I'm doing:
Default.aspx
...uses LoadControl() to load -> Layout.ascx (contains a RadDockLayout with a RadDockZone)
......Layout.ascx then dynamically creates and adds a RadDock to the zone
The error only happens if I load the dock in Page_Init. If I load in Page_Load it works.
The markup from Default.aspx:
The code behind from Default.aspx:
The markup from Default.aspx:
The code behind from Layout.ascx:
The error I'm getting is:
Value cannot be 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.ArgumentNullException: Value cannot be null.
Parameter name: key
Source Error:
Stack Trace:
The problem seems to be internal to the RadDockLaout control. Any idea what is happening?
I'll attach the actual files to a support ticket so you guys can try running them.
Thanks.
-Al
I'm getting the folllowing error when adding a RadDock control to a RadDockZone in Page_Init.
What I'm doing:
Default.aspx
...uses LoadControl() to load -> Layout.ascx (contains a RadDockLayout with a RadDockZone)
......Layout.ascx then dynamically creates and adds a RadDock to the zone
The error only happens if I load the dock in Page_Init. If I load in Page_Load it works.
The markup from Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
<!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> |
</head> |
<body> |
<form id="form1" runat="server"> |
<div> |
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
</telerik:RadScriptManager> |
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> |
</div> |
</form> |
</body> |
</html> |
The code behind from Default.aspx:
using System; |
using System.Web.UI; |
public partial class _Default : System.Web.UI.Page |
{ |
protected void Page_Init(object sender, EventArgs e) |
{ |
Control layout = LoadControl("Layout.ascx"); |
if (layout != null) |
{ |
PlaceHolder1.Controls.Add(layout); |
} |
} |
} |
The markup from Default.aspx:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Layout.ascx.cs" Inherits="Layout" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
<telerik:RadDockLayout ID="DockLayout1" runat="server"> |
<table border="1" cellpadding="0" width="800"> |
<tr> |
<td width="100%" valign="top"> |
<telerik:RadDockZone ID="DockZone1" runat="server" BorderStyle="None"> |
</telerik:RadDockZone> |
</td> |
</tr> |
</table> |
</telerik:RadDockLayout> |
The code behind from Layout.ascx:
using System; |
using System.Web.UI; |
using Telerik.Web.UI; |
public partial class Layout : System.Web.UI.UserControl |
{ |
protected void Page_Init(object sender, EventArgs e) |
{ |
//this causes error |
RadDock dock = new RadDock(); |
RadDockZone zone = FindControl("DockZone1") as RadDockZone; |
zone.Controls.Add(dock); |
} |
protected void Page_Load(object sender, EventArgs e) |
{ |
//this works |
//RadDock dock = new RadDock(); |
//RadDockZone zone = FindControl("DockZone1") as RadDockZone; |
//zone.Controls.Add(dock); |
} |
} |
The error I'm getting is:
Value cannot be null.
Parameter name: key
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.ArgumentNullException: Value cannot be null.
Parameter name: key
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
The problem seems to be internal to the RadDockLaout control. Any idea what is happening?
I'll attach the actual files to a support ticket so you guys can try running them.
Thanks.
-Al