all groups > asp.net building controls > january 2004 >
You're in the

asp.net building controls

group:

Detect change in property within control


Detect change in property within control Stanley Glass
1/6/2004 10:16:31 AM
asp.net building controls:
Is it possble to have a property like so:
[code]
<Bindable(True), Category("Appearance"), Description("The help image
associated with this control."),
Editor(GetType(System.Web.UI.Design.ImageUrlEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property HelpImage() As String
Get
Return imgURL
End Get

Set(ByVal Value As String)
imgURL = Value
End Set
End Property
[/code]

And then be able to detect if the developer has changed it? So that it could
say change the visibility of another control within this same control?
[code]
<Bindable(True), Category("Appearance"), Description("The help image
associated with this control."),
Editor(GetType(System.Web.UI.Design.ImageUrlEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
Public Property HelpImage() As String
Get
Return imgURL
End Get

Set(ByVal Value As String)
imgURL = Value
if Value <> "" then
imgButton.Visible = True
else
imgButton.Visible = False
end if
End Set
End Property
[/code]

-Stanley

Re: Detect change in property within control Stanley Glass
1/6/2004 1:07:29 PM
Never mind, I figured it out. Thanks.

-Stanley

[quoted text, click to view]

Re: Detect change in property within control Alessandro Zifiglio
1/6/2004 6:32:53 PM
If Value Is Nothing Or Value.Length = 0 Then
imgButton.Visible = True
else
imgButton.Visible = False
End If
This is a perfectly correct way to take action if the property has not been
supplied --havent you tested this to work already ? ;P
I actually dont see anything wrong with your code --what is not working ? :S


[quoted text, click to view]

AddThis Social Bookmark Button