question about classes

Results 1 to 2 of 2

Thread: question about classes

  1. #1
    Join Date
    Dec 1969

    Default question about classes

    Hi all,<BR> I have a class file called Properties.vb in which I define a public property as follows<BR>-----------------------------------------------------------<BR>Public Class Properties<BR> Private CalSelectedDate As Date = Now()<BR><BR> Public Property CalSelDate() As Date<BR> Get<BR> Return CalSelectedDate<BR> End Get<BR> Set(ByVal Value As Date)<BR> CalSelectedDate = Value<BR> End Set<BR> End Property<BR><BR>End Class<BR>-----------------------------------------------------------<BR><BR>Now I have Page1.aspx where I create an object of Properties class and set the property value.<BR>I also have Page2.aspx where I create another object of Properies class and try to access the property value - But I dont get it.<BR><BR>Im guessing this is because each object I create has its own memory space...<BR>So how would I be able to accomplish this ? How do I get values from another class ?<BR><BR>TIA,<BR> ajax

  2. #2
    Join Date
    Dec 1969

    Default works as expected

    When you create a New class, it is a New class. You could always store the object in Cache. While off topic, the samples in this link will help.<BR><BR><BR><BR>You could store the object in Session.<BR><BR>If the object is pretty much read only, you could make it a public static object. It gets shared across all users though.<BR><BR>There are a variety of other things you could do as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts