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
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