M
MLibby
How do I implement design time support for a web custom control? For some
reason the control can't seem to find System.Web.UI.Design and I get the
following compiler error:
C:\Documents and Settings\MLibby\My Documents\Visual Studio
Projects\CustomControlEnum\CustCtrlDesigner\CustCtrl.cs(3): The type or
namespace name 'Design' does not exist in the class or namespace
'System.Web.UI' (are you missing an assembly reference?)
Here's my code.
using System;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace CustCtrlDesigner
{
/// <summary>
/// Summary description for CustCtrl.
/// </summary>
[DesignerAttribute(typeof(CustCtrlDesigner), typeof(IDesigner))]
public class CustCtrl : System.Web.UI.WebControls.WebControl
{
protected override void Render(HtmlTextWriter output)
{
output.Write("<center><font size='30'>");
output.Write( "Rendered!");
output.Write("</font></center>");
}
}
public class CustCtrlDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
string html = base.GetDesignTimeHtml();
output.Write("<center><font size='30'>");
output.Write( "Designer!");
output.Write("</font></center>");
}
}
}
reason the control can't seem to find System.Web.UI.Design and I get the
following compiler error:
C:\Documents and Settings\MLibby\My Documents\Visual Studio
Projects\CustomControlEnum\CustCtrlDesigner\CustCtrl.cs(3): The type or
namespace name 'Design' does not exist in the class or namespace
'System.Web.UI' (are you missing an assembly reference?)
Here's my code.
using System;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace CustCtrlDesigner
{
/// <summary>
/// Summary description for CustCtrl.
/// </summary>
[DesignerAttribute(typeof(CustCtrlDesigner), typeof(IDesigner))]
public class CustCtrl : System.Web.UI.WebControls.WebControl
{
protected override void Render(HtmlTextWriter output)
{
output.Write("<center><font size='30'>");
output.Write( "Rendered!");
output.Write("</font></center>");
}
}
public class CustCtrlDesigner : System.Web.UI.Design.ControlDesigner
{
public override string GetDesignTimeHtml()
{
string html = base.GetDesignTimeHtml();
output.Write("<center><font size='30'>");
output.Write( "Designer!");
output.Write("</font></center>");
}
}
}