New Control won't drop on designer page

J

jsh02_nova

Made new control as perscibed by MS web documentation, added control to
toolbar, but control can't be dragged unto new web page.
What ComponentModel Designer property tags did I forget to include?
 
J

jsh02_nova

Code posting:
Imports System
Imports System.Text
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Web.UI
Imports System.Web.UI.Design.ControlDesigner
Imports System.Web.UI.WebControls

<Assembly: TagPrefix("CustomControl", "CustomControl")>

Namespace Common
<Description("Displays details of element"), _
ToolboxData("<{0}:ElementDetail Text=""Element Detail Table""
runat=server ></{0}:ElementDetail>"), _
Designer("CustomControl.Common.ElementDetailDesigner")> _
Public Class ElementDetail : Inherits WebControl

#Region " Properties "
<Browsable(True), Category("Behavior"), Bindable(True),
DefaultValue("2"), Description("Table cellspacing")> _
Property Cellspacing() As Integer
Get
Dim i As Integer = CType(ViewState("Cellspacing"), Integer)
Return CType(IIf(i.Equals(Nothing), CType("2", Object), CType(i,
Object)), Integer)
End Get
Set(ByVal Value As Integer)
ViewState("Cellspacing") = Value
End Set
End Property

#End Region

#Region " Overrides "

'Adds attributes to HTML tag
Protected Overrides Sub AddAttributesToRender(ByVal writer As
System.Web.UI.HtmlTextWriter)
MyBase.AddAttributesToRender(writer)
writer.AddAttribute("InsId", InsId.Trim)
writer.AddAttribute("TypId", TypId.Trim)
writer.AddAttribute("ShowNulls", ShowNulls.ToString)
writer.AddAttribute("ShowZeros", ShowZeros.ToString)
If Cellspacing > 0 Then
writer.AddAttribute("Cellspacing", Cellspacing.ToString)
End If
If Wrap Then
writer.AddAttribute("Wrap", Wrap.ToString)
End If

writer.RenderBeginTag(HtmlTextWriterTag.Span)
writer.RenderEndTag()
End Sub


Protected Overrides Sub RenderContents(ByVal writer As
System.Web.UI.HtmlTextWriter)
writer.WriteLine("<p><h3>Detail</h3><p>")
writer.WriteLine("<table border=""0"" cellspacing=" &
Cellspacing.ToString & ">")
writer.WriteLine("<tr>")
writer.WriteLine("<td span=2><font face=""Arial""
size=""3""><b>Properties:</b></font></td>")
writer.WriteLine("</tr>")
writer.WriteLine("<tr valign=top>")
writer.WriteLine("<td valign=top><font face=""Arial""
size=""2""><b>DisplayName</b></font></td>")
writer.WriteLine("<td valign=top><font face=""Arial""
size=""2"">DisplayValue&nbsp;</font></td>")
writer.WriteLine("</tr>")
'finish table
writer.WriteLine("</table>")
End Sub

Protected Overrides Function CreateControlCollection() As
System.Web.UI.ControlCollection
Return New EmptyControlCollection(Me)
End Function

#End Region
End Class

Public Class ElementDetailDesigner
Inherits System.Web.UI.Design.ControlDesigner

Public Overrides Function GetDesignTimeHtml() As String
Return "<p>ElementDetail/p><hr/><hr/>"
End Function

End Class

End Namespace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top