Property is loosing value

M

MBO

Hello NG,

I've created a custom component inherited from
"System.Web.UI.Webcontrold.Button" and added a new String Property

....

Private _waitMessage As String

<Bindable(True), Category("Appearance"), DefaultValue("Please Wait")> Public
Property [WaitMessage]() As String

Get
Return _waitMessage
End Get
Set(ByVal Value As String)
_waitMessage = Value
End Set
End Property

....

If I'm using the component, I can set the property in the property editor,
but when I built the project it is set back to an empty string. I found out
that when I add the component the following code is added to the webform:

....

<cc1:pleaseWaitButton id="PleaseWaitButton1" style="Z-INDEX: 101; LEFT:
392px; POSITION: absolute; TOP: 208px"
runat="server" Text="Search" Width="440px"
Height="128px"></cc1:pleaseWaitButton>

....

It seems that the "WaitMessage" attribute is missing, if I manually add the
attribute like


<cc1:pleaseWaitButton id="PleaseWaitButton1" style="Z-INDEX: 101; LEFT:
392px; POSITION: absolute; TOP: 208px"
runat="server" Text="Search" WaitMessage="Please Wait" Width="440px"
Height="128px"></cc1:pleaseWaitButton>

....

the probelm is solved, the property holds its value also when I build the
project.

What do I need to change in the property or component, that the
"WaitMessage" attribute is inserted automatically when I insert the
component to a webform ?

Thanks and Regards

MBO
 

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,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top