E
Eidolon
I have written my own class deriving from WebControl. The HTML that the
control puts out is such that it is not visible to the user, including in
design time. I am trying to add a ControlDesigner to my class, which would
put a visual bit out at design-time, similar to the grey box the designer
puts out when it encounters an error creating a control, just for
visibility, and so you can select the control by clicking on it.
It does not seem to work though. The control works fine, but the visual
design part doesnt show up.
Any help appreciated. Thanks!
Code follows:
Public Class ClientFormDesigner
Inherits System.Web.UI.design.ControlDesigner
Public Overrides Function GetDesignTimeHtml() As String
Dim html As String = "<div style='width: 100px; height: 30px;
border: solid 2px; outset; background-color: black;'>?</div>"
html = html.Replace("?", MyBase.ID & "<br>" &
MyBase.GetDesignTimeHtml)
Return html
End Function
End Class
<DesignerAttribute(GetType(Designers.ClientFormDesigner),
GetType(IDesigner)), DefaultProperty("Action"), ToolboxData("<{0}:ClientForm
runat=server></{0}:ClientForm>")> Public Class ClientForm
Inherits System.Web.UI.WebControls.WebControl
[ properties ommited for brevity ]
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
[ custom render code here. works fine ]
End Sub
End Class
control puts out is such that it is not visible to the user, including in
design time. I am trying to add a ControlDesigner to my class, which would
put a visual bit out at design-time, similar to the grey box the designer
puts out when it encounters an error creating a control, just for
visibility, and so you can select the control by clicking on it.
It does not seem to work though. The control works fine, but the visual
design part doesnt show up.
Any help appreciated. Thanks!
Code follows:
Public Class ClientFormDesigner
Inherits System.Web.UI.design.ControlDesigner
Public Overrides Function GetDesignTimeHtml() As String
Dim html As String = "<div style='width: 100px; height: 30px;
border: solid 2px; outset; background-color: black;'>?</div>"
html = html.Replace("?", MyBase.ID & "<br>" &
MyBase.GetDesignTimeHtml)
Return html
End Function
End Class
<DesignerAttribute(GetType(Designers.ClientFormDesigner),
GetType(IDesigner)), DefaultProperty("Action"), ToolboxData("<{0}:ClientForm
runat=server></{0}:ClientForm>")> Public Class ClientForm
Inherits System.Web.UI.WebControls.WebControl
[ properties ommited for brevity ]
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
[ custom render code here. works fine ]
End Sub
End Class