I have created a custom control that used to drag and drop fine from the toolbox but now when I try to drag and drop it I get the nice symbol saying that can't be dropped here and I'm not sure what I changed to cause this. I have tried undoing everything I changed, that I can remember but I still can't figure out why it would stop working. Here is the code.
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
<ToolboxData("<{0}:Javascript runat=""server""></{0}:Javascript>"), DefaultProperty("Text"), Designer("Javascript.JavascriptDesigner, javascript")> _
Public Class Javascript
Inherits Control
Private jscriptText As String
Private jscriptSource As String
<Browsable(True), Bindable(True), Category("Appearance"), Description("This is the javascript code that will be placed in the script tag.")> _
Public Property Text() As String
Get
Return jscriptText
End Get
Set(ByVal Value As String)
jscriptText = Value
End Set
End Property
<Browsable(True), Bindable(True), Category("Appearance"), Description("This is the html url(relative or absolute) that will be placed in the src attribute.")> _
Public Property Source() As String
Get
Return jscriptSource
End Get
Set(ByVal Value As String)
jscriptSource = Value
End Set
End Property
Public Sub New()
End Sub
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim output As String
writer.Write(vbCrLf)
writer.AddAttribute("type", "text/javascript")
writer.AddAttribute("language", "javascript")
If Not jscriptSource Is Nothing And jscriptSource <> "" Then
writer.AddAttribute("src", jscriptSource)
End If
writer.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Script)
If Not jscriptText Is Nothing And jscriptText <> "" Then
writer.WriteLine(jscriptText)
End If
writer.RenderEndTag()
End Sub
End Class