Hi,
I've had a good search around but can't seem to find the issue with this. I've
made a little breadcrumb system for the top of our pages which is generated
from a collection. Until yesterday it was working fine but suddenly (and to my
knowledge without a change in the code) its stopped rendering in the Design
Time view of visual studio with the error "Error Creating Control".
Here's my code (some omitted for brevity). Can anyone see what?s wrong?
Thanks.
Tim
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Common.Geographics;
using System.Collections;
using Data.Constants;
namespace NavigationControls
{
/// <summary>
/// Generates a breadcrumb
system of the current location
/// </summary>
[
DefaultProperty("Text"),
ToolboxData("<{0}:AreaBreadCrumbs
runat=server></{0}:AreaBreadCrumbs>"),
Designer("NavigationControls.wcAreaBreadCrumbsDesigner,
GeneralControls")
]
public class
AreaBreadCrumbs : System.Web.UI.WebControls.WebControl
{
/// <summary>
/// strRender is set to display
links Design View.
/// </summary>
private string
strRender = "<a>Home</a> >
<a>Level 1</a> > <a>Level 2</a> > <a>Level
3</a>";
private string
strNoRender = "Not Visible at Runtime with
Current Settings";
[
Bindable(true),
Category("Custom"),
DefaultValue(""),
Description("Set the Design View Render HTML String")
]
public string
RenderHTML
{
get
{
return strRender;
}
set
{
strRender
= value;
}
}
[
Bindable(true),
Category("Custom"),
DefaultValue(""),
Description("Set the Design View NoRender HTML String")
]
public string
NoRenderHTML
{
get
{
return strNoRender;
}
set
{
strNoRender
= value;
}
}
protected override void CreateChildControls()
{
//Code ommitted
}
}
/// <summary>
/// Summary description for
wcCountryCodeControlDesigner.
/// </summary>
public class
wcAreaBreadCrumbsDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
//cast the underlying Component to a AreaBreadCrumbs
//so that we have access to the design time Property -
RenderHTML
AreaBreadCrumbs
bc = (AreaBreadCrumbs)Component;
return bc.RenderHTML;
}
protected override string GetEmptyDesignTimeHtml()
{
//cast the underlying Component to a
CountryCodeDropDownList
//so that we have access to the design time Property -
NoRenderHTML
AreaBreadCrumbs
bc = (AreaBreadCrumbs) Component;
return CreatePlaceHolderDesignTimeHtml(bc.NoRenderHTML);
}
}
}