Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Question about DLL in ASP

Reply
Thread Tools

Question about DLL in ASP

 
 
Fie Fie Niles
Guest
Posts: n/a
 
      08-13-2004
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.


 
Reply With Quote
 
 
 
 
Roji. P. Thomas
Guest
Posts: n/a
 
      08-14-2004
You have to perisist the data somewhere.
DLLS cant keep them in memory and Session variables
are not the right choice.

Save them to the database while the user saves every page.
Use a flag to denote whether the entry is completed, or use an auxilary
table which can be cleared periodically.

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


"Fie Fie Niles" <(E-Mail Removed)> wrote in message
news:OxZO%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
 
John
Guest
Posts: n/a
 
      08-14-2004
You can also transfert the variables from the 1 to the 2 page and store
them in HIDDEN FIELDS

Response.Write "<INPUT TYPE=""HIDDEN"" VALUE=" & Chr(34) &
Request.QueryString("FirstName") & Chr(34) & " NAME=""Firstname"">


 
Reply With Quote
 
fniles
Guest
Posts: n/a
 
      08-14-2004
Thanks.
May I know why using Session variable is not a good idea ?

Also, would you please confirm that passing object variable (like
oProcess from Process.dll) in a session is not a good idea, and that it
is better before I exit the ASP page, to set the oProcess variable to
nothing (set oProcess = nothing) ?

Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
fniles
Guest
Posts: n/a
 
      08-14-2004
Thank you.
Passing the variable in the hidden field is a good idea.

Would you please confirm that it is not a good idea to pass an object
variable (like oProcess from Process.dll) in a session variable, and it
is better before I exit the ASP page, to set the oProcess variable to
nothing (set oProcess = nothing) ?

Thanks.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      08-14-2004
fniles wrote:
> Thank you.
> Passing the variable in the hidden field is a good idea.
>
> Would you please confirm that it is not a good idea to pass an object
> variable (like oProcess from Process.dll) in a session variable,


http://blogs.msdn.com/ericlippert/ar.../18/53050.aspx

> and
> it is better before I exit the ASP page, to set the oProcess variable
> to nothing (set oProcess = nothing) ?
>

That's more controversial:
http://blogs.msdn.com/ericlippert/ar...28/122259.aspx

With ADO objects, it is still my practice to explicitly close and destroy
them in the proper order, since they involve child objects (child objects
need to be released before the poarent objects that created them). With more
well-behaved objects, unless they take up a lot of resources/memory (in
which case they be destroyed as soon as you are finished with them), you can
allow the automatic cleanup to take care of them.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Roji. P. Thomas
Guest
Posts: n/a
 
      08-16-2004
http://msdn.microsoft.com/library/de...ml/ASPtips.asp

--
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com


"fniles" <(E-Mail Removed)> wrote in message
news:u$(E-Mail Removed)...
> Thanks.
> May I know why using Session variable is not a good idea ?
>
> Also, would you please confirm that passing object variable (like
> oProcess from Process.dll) in a session is not a good idea, and that it
> is better before I exit the ASP page, to set the oProcess variable to
> nothing (set oProcess = nothing) ?
>
> Thank you
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
Asp.net app, Unable to load dll!!, while same dll loads properly in Win form app NGM ASP .Net 0 11-06-2003 10:34 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments