ASP Objects and COM COmponent

A

abcd

I have following ActiveX DLL code which accesses the Controls on an asp page
using request object. Can somebody tell me the difference and between these
2 methods (Load() and Load2()). Which one is more efficient.

Load2 usese ObjectContext and Load uses scriptingcontext. Whats the
difference.

------------------------------------------------------------------------------


Dim ASPsc As ScriptingContext

Public Function Load() As Variant

'Dim req As ASPTypeLibrary.Request
Dim scObj As ScriptingContext
Set scObj = ASPsc

x = CStr(scObj.Request("name"))
y = CStr(scObj.Request("LName"))

x = x + y

Load = x

End Function

Public Sub OnStartPage(ASP_Scripting_Context As ScriptingContext)

'Set global variable so we can reference
'scripting context in other functions and subs
Set ASPsc = ASP_Scripting_Context

End Sub


Public Function Load2() As Variant
Dim req As ASPTypeLibrary.Request

Dim objContext As ObjectContext
Set objContext = GetObjectContext()

Set req = objContext("Request")

x = CStr(req("name"))
y = CStr(req("LName"))

x = x + y

Load2 = x

End Function
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top