Form information retrieval

G

Guest

Hi. I have a little bit of a problem. I'm working on a school project and can't figure this one thing out. I have a program that has 21 forms, the first one being the home page and the others being math questions. It's a program I'm developing for grade three students. What I'm stuck on is retrieving the information from the other 20 forms and inputting it onto a textbox or whatever i need to on the home page to show the kids how well they did. This also encompases determining whether the question is right or wrong. Any help would be greatly appreciated. Thank you.
 
P

Pete Beech

I assume the users progress through the question forms in a linear fashion?
If so, you might be looking at it the wrong way. You shouldn't try to read
the results from each form (these webforms normally* only exist on the
server momentarily, as they are being rendered).

Instead, as you go through the forms, you can add the results or whatever
information you need to an array or other data structure which is stored in
the Session object. The Session object is a place to store information on
the server, just for the particular user using the webapp at the time. The
array of information that you store in the Session object will still be
available to you on the results page.

As an example, the code could be something like this (in C#, very similar in
VB).

On your first page, store the array in the Session:
Session["Results"] = new ArrayList();

on question pages:
to get the array:
ArrayList arResults = (ArrayList)Session["Results"];

add something to the array:
arResults.Add(new Result(....));


on results page:
ArrayList arResults = (ArrayList)Session["Results"];

// iterate through
foreach (Result res in arResults)
{
... do something for each result
}

I hope thats enough to give you some ideas,
Cheers,
Pete Beech

* Sometimes the system holds onto them, e.g. if you set an event on some
Application or Session level object to point to an event handler on a
particular instance of a form.


Sway said:
Hi. I have a little bit of a problem. I'm working on a school project and
can't figure this one thing out. I have a program that has 21 forms, the
first one being the home page and the others being math questions. It's a
program I'm developing for grade three students. What I'm stuck on is
retrieving the information from the other 20 forms and inputting it onto a
textbox or whatever i need to on the home page to show the kids how well
they did. This also encompases determining whether the question is right or
wrong. Any help would be greatly appreciated. Thank you.
 

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,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top