public class TestDesigner : ControlDesigner
{
public override string GetPersistInnerHtml()
{
return text.ToString();
}
public override string GetDesignTimeHtml()
{
try
{
return “();
}
catch (Exception e)
{
return GetErrorDesignTimeHtml(e);
}
}
protected override string GetEmptyDesignTimeHtml()
{
//Render design time warning if there's nothing to display.
string text = "Please add Services to the toolbar.";
return CreatePlaceHolderDesignTimeHtml(text);
}
protected override string GetErrorDesignTimeHtml(Exception e)
{
string text = string.Format("{0}{1}{2}{3}",
"There was an error and the control can't be displayed.",
"<BR>", "Exception: ", e.Message);
return CreatePlaceHolderDesignTimeHtml(text);
}
}
[Designer(typeof(ScriptManagerDesigner))]
public class Test
{
}