How to Post back OBjects and remember State

R

RSB

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(StudentObject)
RemoveStudent(studentID)


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
 
C

Cor Ligthert

Hi RSB,

It is easier to set them in a dataset, that you can simple at to a
session.variable 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top