I want to create a button that implements an interface I have designed. I have done the same for a label and it worked like a charm. But the button is giving me a headache... here is the code:
VB Code:
mports System.ComponentModel Imports System.Web.UI Imports COmpany.Common.Web.Interfaces <ToolboxData("<{0}:LocalizedButton runat=server></{0}:LocalizedButton>")> Public Class LocalizedButton Inherits System.Web.UI.WebControls.Button : Implements ILocalizable Private _textId As Integer Private _isLocalized As Boolean <Bindable(False), Category("Behavior"), DefaultValue("")> Public Property IsLocalized() As Boolean Implements ILocalizable.IsLocalized Get Return _isLocalized End Get Set(ByVal Value As Boolean) _isLocalized = Value End Set End Property Public Sub SetText(ByVal text As String) Implements ILocalizable.SetText Me.Text = text End Sub <Bindable(False), Category("Behavior"), DefaultValue("")> Public Property TextId() As String Implements ILocalizable.TextId Get Return Me._textId End Get Set(ByVal Value As String) Me._textId = Value End Set End Property End Class
The same thing worked for a label...
Here is the result I get when I do dra/drop to the webform:
VB Code:
<cc2:LocalizedButton id=LocalizedButton1 runat="server"></cc2:LocalizedButton<!--EndFragment--> </BODY></HTML></cc2:LocalizedButton><!--TRIDESIGNCOMMENT-,TRIDESIGNCOMMENTEND-TRIDESIGNPRECOMMENT-EndFragment-->
If I remove the bad html code it works beautifully!!!! But it is very annoying to have to do cleanup for every control I add. What is the problem here??
kind regards
Henrik




Reply With Quote