Layout Custom Control - receiving error w/ multiple content blocks
I'm building a custom layout control and have it working just fine except i'm getting an error when I drop more than 1 content block into a placeholder.
I suspect I need to override something in my CustomControl to assign something a unique name, but not sure what.
My Custom Control code:
01.
public
class
WebCustomControl1 : LayoutControl
02.
03.
/// <summary>
04.
/// CustomTemplate lets you supply a template.ascx file to render the layout.
05.
/// </summary>
06.
public
string
CustomTemplate =
"SitefinityWebApp.LayoutControls.Layout1.ascx"
;
07.
08.
public
override
string
Layout
09.
10.
get
return
this
.CustomTemplate;
11.
set
CustomTemplate = value;
12.
13.
14.
public
override
string
AssemblyInfo
15.
16.
get
return
GetType().ToString();
17.
set
base
.AssemblyInfo = value;
18.
19.
20.
protected
override
void
CreateChildControls()
21.
22.
base
.CreateChildControls();
23.
24.
<%@ Control Language="C#" %>
<
div
class
=
"trio first"
>
<
div
id
=
"div1"
runat
=
"server"
class
=
"sf_cols"
>
<
div
id
=
"div2"
runat
=
"server"
class
=
"sf_colsOut"
>
<
div
id
=
"div3"
runat
=
"server"
class
=
"sf_colsIn"
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"trio"
>
<
div
id
=
"Div4"
runat
=
"server"
class
=
"sf_cols"
>
<
div
id
=
"div5"
runat
=
"server"
class
=
"sf_colsOut"
>
<
div
id
=
"div6"
runat
=
"server"
class
=
"sf_colsIn"
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"trio last"
>
<
div
id
=
"Div7"
runat
=
"server"
class
=
"sf_cols"
>
<
div
id
=
"div8"
runat
=
"server"
class
=
"sf_colsOut"
>
<
div
id
=
"div9"
runat
=
"server"
class
=
"sf_colsIn"
>
</
div
>
</
div
>
</
div
>
</
div
>
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. |
|
A rebuild of the project and restart of Sitefinity resolved this.