F
Fie Fie Niles
I was given the following scenario, and would like to confirm what the
correct answer will be.
Say you have 3 ASP pages, on each page the user needs to complete
information.
Page 1: first name and last name.
When user click the "next" button, go to Page 2. The ASP page calls a VB DLL
(say Process.DLL) to enter the information for first name and last name.
Page 2: address
When user click the "next" button, go to Page 3. The ASP page calls a VB DLL
(say Process.DLL) to enter the information for address.
Page 3: age
When user click the "save" button, you need to save the information entered
on page 1, 2 and 3 into a database.
The question is: by the time you are on the 3rd page, will the data from
Page 1 and 2 still in the Process.DLL ?
In my opinion, instead of calling the DLL on Page 1 and 2, use Session
variables to store the first name, last name and address from Page 1 and 2.
When you get to Page 3, pass the Session variable to the Process.DLL.
Usually when I call a DLL (Set oProcess =
server.CreateObject("ProcessObject.clsA"), before I exit this ASP page, I
will set the oProcess variable to nothing (set oProcess = nothing). I read
that passing an object like oProcess in a Session variable is not a good
idea.
So, when I get to Page 2, oProcess will be a new instance again, thus the
information from Page 1 won't be there anymore.
Would you please give me your opinion on this. Is the method to call the DLL
on each page a better idea, and will you get all info from Page 1 and 2 by
the time you are on Page 3, or using the Session Variable to store the first
name, last name and address from Page 1 and 2 is a better idea ?
Thank you.
correct answer will be.
Say you have 3 ASP pages, on each page the user needs to complete
information.
Page 1: first name and last name.
When user click the "next" button, go to Page 2. The ASP page calls a VB DLL
(say Process.DLL) to enter the information for first name and last name.
Page 2: address
When user click the "next" button, go to Page 3. The ASP page calls a VB DLL
(say Process.DLL) to enter the information for address.
Page 3: age
When user click the "save" button, you need to save the information entered
on page 1, 2 and 3 into a database.
The question is: by the time you are on the 3rd page, will the data from
Page 1 and 2 still in the Process.DLL ?
In my opinion, instead of calling the DLL on Page 1 and 2, use Session
variables to store the first name, last name and address from Page 1 and 2.
When you get to Page 3, pass the Session variable to the Process.DLL.
Usually when I call a DLL (Set oProcess =
server.CreateObject("ProcessObject.clsA"), before I exit this ASP page, I
will set the oProcess variable to nothing (set oProcess = nothing). I read
that passing an object like oProcess in a Session variable is not a good
idea.
So, when I get to Page 2, oProcess will be a new instance again, thus the
information from Page 1 won't be there anymore.
Would you please give me your opinion on this. Is the method to call the DLL
on each page a better idea, and will you get all info from Page 1 and 2 by
the time you are on Page 3, or using the Session Variable to store the first
name, last name and address from Page 1 and 2 is a better idea ?
Thank you.