P
PJ6
I get this design-time error (below) when setting thus property in my
inherited web control to 'True'. I've debugged the code running at
design-time to double check to see that no exception was being thrown. While
there are other people that have run into this exception, what I've found so
far hasn't been helpful.
What is the proper way to declare custom Boolean properties that need to be
persisted in attributes through the Web Forms designer?
Paul
There was an error rendering the control.
'True' could not be set on property 'ShowEmptySelection'.
<DefaultValue(False), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
_
PersistenceMode(PersistenceMode.Attribute), _
Bindable(True), Category("Appearance")> _
Public Overridable Property ShowEmptySelection() As Boolean
Get
Dim ret As Boolean = False
Dim o As Object = Me.ViewState("ShowEmptySelection")
If Not o Is Nothing Then
ret = CBool(o)
End If
Return ret
End Get
Set(ByVal value As Boolean)
Me.ViewState("ShowEmptySelection") = value
End Set
End Property
inherited web control to 'True'. I've debugged the code running at
design-time to double check to see that no exception was being thrown. While
there are other people that have run into this exception, what I've found so
far hasn't been helpful.
What is the proper way to declare custom Boolean properties that need to be
persisted in attributes through the Web Forms designer?
Paul
There was an error rendering the control.
'True' could not be set on property 'ShowEmptySelection'.
<DefaultValue(False), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible),
_
PersistenceMode(PersistenceMode.Attribute), _
Bindable(True), Category("Appearance")> _
Public Overridable Property ShowEmptySelection() As Boolean
Get
Dim ret As Boolean = False
Dim o As Object = Me.ViewState("ShowEmptySelection")
If Not o Is Nothing Then
ret = CBool(o)
End If
Return ret
End Get
Set(ByVal value As Boolean)
Me.ViewState("ShowEmptySelection") = value
End Set
End Property