Help with persistance

Discussion in 'ASP .Net' started by CCORDON, Dec 28, 2004.

  1. CCORDON

    CCORDON Guest

    I have some classes that contain my objects...say..... Client...with all his
    properties, Methods & Events. I use this on my web pages like this.


    Dim MyClient as New Client(IdCorporation)

    This because I need the information of that client as a reference.

    Then I use:

    If not page.IsPostBack then

    Dim MyOtherClient as New Client ()
    This is created just to use a function from that class:
    MyOtherClient.Add (Name, Address, City, Zip, Phone)

    Endif

    The problem is that when a postback occurs...MyOtherClient = MyClient.

    How should this be handled?

    Thanks
     
    CCORDON, Dec 28, 2004
    #1
    1. Advertising

  2. CCORDON

    Scott Allen Guest

    Hi cc:

    I'm afraid you'll have to give a better description of the problem. Is
    there an incorrect result? An error message? Where did the instance
    MyOtherClient come from?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Tue, 28 Dec 2004 17:08:28 -0600, "CCORDON" <>
    wrote:

    >I have some classes that contain my objects...say..... Client...with all his
    >properties, Methods & Events. I use this on my web pages like this.
    >
    >
    >Dim MyClient as New Client(IdCorporation)
    >
    >This because I need the information of that client as a reference.
    >
    >Then I use:
    >
    >If not page.IsPostBack then
    >
    >Dim MyOtherClient as New Client ()
    >This is created just to use a function from that class:
    >MyOtherClient.Add (Name, Address, City, Zip, Phone)
    >
    >Endif
    >
    >The problem is that when a postback occurs...MyOtherClient = MyClient.
    >
    >How should this be handled?
    >
    >Thanks
    >
     
    Scott Allen, Dec 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Atif Jalal

    collection of Objects persistance

    Atif Jalal, Aug 13, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    368
    Atif Jalal
    Aug 13, 2003
  2. Free
    Replies:
    2
    Views:
    1,118
    Brian
    Oct 20, 2003
  3. Lucas, Todd
    Replies:
    0
    Views:
    705
    Lucas, Todd
    May 8, 2004
  4. Amadelle
    Replies:
    1
    Views:
    375
    John Saunders
    Jun 5, 2004
  5. Namshub

    persistance of Classes

    Namshub, Mar 18, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    452
    =?Utf-8?B?Sm9obiBUZWFndWU=?=
    Mar 18, 2005
Loading...

Share This Page