Home All Groups Group Topic Archive Search About
Author
10 Dec 2006 4:49 PM
Bert
Hi

I am trying to add a property to a class that is derive from
asp:placeholder. ? I have tried this but get an ambigous name error:

Imports System.ComponentModel

Imports System.Web.UI





<DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl1
runat=server></{0}:WebCustomControl1>")> Public Class WebCustomControl1

Inherits System.Web.UI.WebControls.PlaceHolder

Dim _text As String

Dim _kutje As String

<Bindable(True), Category("Appearance"), DefaultValue("")> Property [Text]()
As String

Get

Return _text

End Get

Set(ByVal Value As String)

_text = Value

End Set

End Property

Public Property kutje() As String

Get

Return _kutje

End Get

Set(ByVal Value As String)

_kutje = Value

End Set

End Property

Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

output.Write([Text])

End Sub

End Class


How to go about?

thanks

B

Author
11 Dec 2006 9:37 AM
Master Programmer
Remove the "Text" property from the class file.

The Grand Master


Bert wrote:
Show quoteHide quote
> Hi
>
> I am trying to add a property to a class that is derive from
> asp:placeholder. ? I have tried this but get an ambigous name error:
>
> Imports System.ComponentModel
>
> Imports System.Web.UI
>
>
>
>
>
> <DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl1
> runat=server></{0}:WebCustomControl1>")> Public Class WebCustomControl1
>
> Inherits System.Web.UI.WebControls.PlaceHolder
>
> Dim _text As String
>
> Dim _kutje As String
>
> <Bindable(True), Category("Appearance"), DefaultValue("")> Property [Text]()
> As String
>
> Get
>
> Return _text
>
> End Get
>
> Set(ByVal Value As String)
>
> _text = Value
>
> End Set
>
> End Property
>
> Public Property kutje() As String
>
> Get
>
> Return _kutje
>
> End Get
>
> Set(ByVal Value As String)
>
> _kutje = Value
>
> End Set
>
> End Property
>
> Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
>
> output.Write([Text])
>
> End Sub
>
> End Class
>
>
> How to go about?
>
> thanks
>
> B
Author
12 Dec 2006 9:19 AM
Master Programmer
I just ran your code and it worked fine

The Grand Master


Bert wrote:
Show quoteHide quote
> Hi
>
> I am trying to add a property to a class that is derive from
> asp:placeholder. ? I have tried this but get an ambigous name error:
>
> Imports System.ComponentModel
>
> Imports System.Web.UI
>
>
>
>
>
> <DefaultProperty("Text"), ToolboxData("<{0}:WebCustomControl1
> runat=server></{0}:WebCustomControl1>")> Public Class WebCustomControl1
>
> Inherits System.Web.UI.WebControls.PlaceHolder
>
> Dim _text As String
>
> Dim _kutje As String
>
> <Bindable(True), Category("Appearance"), DefaultValue("")> Property [Text]()
> As String
>
> Get
>
> Return _text
>
> End Get
>
> Set(ByVal Value As String)
>
> _text = Value
>
> End Set
>
> End Property
>
> Public Property kutje() As String
>
> Get
>
> Return _kutje
>
> End Get
>
> Set(ByVal Value As String)
>
> _kutje = Value
>
> End Set
>
> End Property
>
> Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
>
> output.Write([Text])
>
> End Sub
>
> End Class
>
>
> How to go about?
>
> thanks
>
> B