Property. Control or View State?
- From: shapper <mdmoura@xxxxxxxxx>
- Date: 30 May 2007 05:10:06 -0700
Hello,
I am creating a control which I will compile in a class.
I am having problems when I use a property in the View State:
' Items
<Bindable(True), Category("Data"), DefaultValue(""),
Localizable(True)> _
Property Items() As Generic.List(Of String)
Get
If ViewState("Items") Is Nothing Then
Return New Generic.List(Of String)
Else
Return ViewState("Items")
End If
End Get
Set(ByVal Value As Generic.List(Of String))
ViewState("Items") = Value
End Set
End Property ' Items
But I don't get problems if I use it in Control State:
Private _Items As New Generic.List(Of String)
Public Property Items() As Generic.List(Of String)
Get
Return _Items
End Get
Set(ByVal value As Generic.List(Of String))
_Items = value
End Set
End Property ' Items
Anyway, this is a little bit confusing to me.
Could someone tell me which one should I use?
I am working on ASP.NET 2.0.
Thanks,
Miguel
.
- Follow-Ups:
- Re: Property. Control or View State?
- From: marss
- Re: Property. Control or View State?
- Prev by Date: Microsoft Ajax framework 1.0 issue
- Next by Date: Property. Which one should I use?
- Previous by thread: Microsoft Ajax framework 1.0 issue
- Next by thread: Re: Property. Control or View State?
- Index(es):
Relevant Pages
|