User-1790770463 posted
Hello all,
I am just beginning to tinker with server controls to learn as much as I can as I prep to develop my own. To start, I have a simple webcontrol which inherits from
System.Web.UI.WebControls.Label. The whole class so far looks like this...
============================
Imports System.Web.UI.WebControls
Public Class
Label
Inherits
System.Web.UI.WebControls.Label
End Class
=============================
In a custom toolbox, I create a WebControlToolboxItem as follows:
Dim
new_webcontroltoolboxitem As
New
WebControlToolboxItem(myToolsAssembly.GetType("Label"))
After this, I also set the following properties with values:
new_webcontroltoolboxitem.AssemblyName
new_webcontroltoolboxitem.Company
new_webcontroltoolboxitem.Bitmap
new_webcontroltoolboxitem.Description
new_webcontroltoolboxitem.DisplayName
new_webcontroltoolboxitem.TypeName
As a test at this point, I call GetToolHtml to get the html of the webcontrol but it returns "" ie, an empty string.
Dim
html As
String = new_webcontroltoolboxitem.GetToolHtml(host)
Again, as a test I also call GetToolType
Dim
controltype As Type = new_webcontroltoolboxitem.GetToolType(host)
and it brings back the correct type. What am I missing? Does anyone have any perspective on what I'm doing wrong? Thanks.
- Randolph