Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Persisting Collection in Component

Reply
Thread Tools

Persisting Collection in Component

 
 
Shawn B.
Guest
Posts: n/a
 
      10-04-2004
I have a component that derives from "Component" but I cannot make a
collection property persist, it always loses its state next time I eneter
the page or rebuild the project...


-----------

Imports System.ComponentModel

Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls

Imports System.Web
Imports system.Web.UI
Imports System.Web.UI.WebControls


<ToolboxItem(True)> _
Public NotInheritable Class XmlRulesValidator
Inherits System.ComponentModel.Component

#Region " Component Designer generated code "

Public Sub New(ByVal Container As System.ComponentModel.IContainer)
MyClass.New()

'Required for Windows.Forms Class Composition Designer support
Container.Add(Me)
End Sub

Public Sub New()
MyBase.New()

'This call is required by the Component Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Component overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

#End Region

Private _defaultRulesFile As String =
"/universal_validation/validation_rules.xml"
Private _rules As XmlRuleCollection


<Category("Behavior")> _
Public Property DefaultRulesFile() As String
Get
Return _defaultRulesFile
End Get
Set(ByVal Value As String)
_defaultRulesFile = Value
End Set
End Property

< _
Category("Behavior"), _
DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)
_
> _

Public ReadOnly Property Rules() As XmlRuleCollection
Get
If (_rules Is Nothing) Then
_rules = New XmlRuleCollection()
End If

Return _rules
End Get
End Property

End Class


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
Persisting collection data of a webcontrol when leaving the collection editor in VS2005 mehdi.mousavi@gmail.com ASP .Net Building Controls 1 05-19-2006 03:49 PM
persisting collection in a custom datagrid john_teague ASP .Net 0 12-06-2005 11:26 PM
persisting collection in a custom datagrid john_teague ASP .Net 0 12-06-2005 11:04 PM
Persisting Component Datatypes in Custom Controls Garry McGlennon ASP .Net Building Controls 0 06-21-2004 08:09 AM



Advertisments