ASP.Net VB modules problem?

clarkeyboy

New member
Hi,

I have the following code in a module:

Namespace Heritage.Web
Public Module HeritageCatalogue
Private _id As Integer = 0
Private _SiteContent As Heritage.Web.SiteContent = New Heritage.Web.SiteContent()

Public ReadOnly Property MySiteContent() As SiteContent
Get
Return _SiteContent
End Get
End Property

Public ReadOnly Property id() As Integer
Get
_id += 1
Return _id
End Get
End Property
End Module
End Namespace

Basically class SiteContent contains all the data from a database, but puts it in a form that meaningful to the programmer (ie me at the moment). I have several classes - Range, Collection, Design and RangeCollection (this is used to tell which Collections are available for which Ranges). In the RangeCollection class I have two objects - one for the Range and one for the Collection.

The problem is that when I try to access property MySiteContent from the RangeCollection class (to set the instances for the Range and Collection), it says that MySiteContent returns nothing, but when I access the property ID from RangeCollection, it increases the ID value by one and prints it (as expected).

My question is simple. Why is the MySiteContent property returning nothing when other variables, declared in the exact same way, return a value based on their previous value? Ive been working on this for ages and cant figure out why it is doing this - in my mind it should work perfectly.

Thanks in advance for any help.

Richard
 
Back
Top