How to Post back OBjects and remember State

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RSB

    #1

    How to Post back OBjects and remember State

    Hi Every One,

    How do i create Objects and then remember the state of the Objects once we
    do the post back.

    Here is what i am trying to Do. .

    I have to objects. A object Called CollegeClass with the Following Fileds.
    ClassID,
    ClassName,
    StartDate,
    EndDate,
    Comments,
    Students --- this is a collection

    with these Two Methods
    AddStudent(Stud entObject)
    RemoveStudent(s tudentID)


    And the Second Class is Students
    StudentID,
    StudentName,
    DateOfBirth,
    Phone.


    Now i want to create a screeen where user can add/Remove the Students and
    once Done then Click on the "Create CollegeClass'" Button to create the
    Class and Students in the Database.

    So my question here is till the Time User Click on the "Create CollegeClass
    " button how do i keep every thing in the Memory .. or how do i remeber the
    state of these Objects

    thanks

    RSB


  • Cor Ligthert

    #2
    Re: How to Post back OBjects and remember State

    Hi RSB,

    It is easier to set them in a dataset, that you can simple at to a
    session.variabl e and get it back after the postback. This one you have to
    serialize or to make a shared class where you have as well indexed which
    session it belongs to.

    This is because a webpage is stateless.

    A shared class belongs in a webpage to all sessions.

    Adataset is in my opinion one of the object under the objects, a dataset
    holds a lot of references, a dataset itself holds not any data at all.

    However maybe someone has a great idea with selfmade classes?

    Cor
    [color=blue]
    > How do i create Objects and then remember the state of the Objects once we
    > do the post back.
    >
    > Here is what i am trying to Do. .
    >
    > I have to objects. A object Called CollegeClass with the Following Fileds.
    > ClassID,
    > ClassName,
    > StartDate,
    > EndDate,
    > Comments,
    > Students --- this is a collection
    >
    > with these Two Methods
    > AddStudent(Stud entObject)
    > RemoveStudent(s tudentID)
    >
    >
    > And the Second Class is Students
    > StudentID,
    > StudentName,
    > DateOfBirth,
    > Phone.
    >[/color]


    Comment

    Working...