Callbacs in ASP

C

CNemo

Hi All!

I would like to be able to make callback function in ASP VBScript.
Last time when i saw it was impossible...

Is something changed in this area now? Maybe workarounds?
 
B

Bob Barrows [MVP]

CNemo said:
Hi All!

I would like to be able to make callback function in ASP VBScript.
Last time when i saw it was impossible...

Is something changed in this area now? Maybe workarounds?

Could you get more specific? What are you trying to do?
 
C

CNemo

I would like to have template function to output table, which will accept
other function as a parameter to renrer row.
Sounds to cool for VB?
 
B

Bob Barrows [MVP]

It sounds do-able with a SSI. Why is a "callback" function needed, and what
do you mean by "callback"?
 
P

Patrice

I would pass an object that provides the needed function. You have also
Eval/Execute. I'm not sure but if I remember you don't have even in
VBScript... do You ?
 
C

CNemo

You mean create class and pass it's instance and then call it's method
inside?
That might be neat.
Thanks a lot! I'll try it.

But if you did it already, i'll will really appreciate small sample!
 
P

Patrice

Something like :

Class ProviderA
Sub DoSomething
Response.Write "ProviderA.DoSomething"
End Sub
End Class

Sub Render(Provider)
Provider.DoSomething
End Sub

Render New ProviderA


Later you can create another class such as ProviderB and pass an object.
Basically you are on your won to ensure that both object expose the same set
or methods/properties...
 
C

CNemo

Thanks!
Nice use for strategy pattern!

Patrice said:
Something like :

Class ProviderA
Sub DoSomething
Response.Write "ProviderA.DoSomething"
End Sub
End Class

Sub Render(Provider)
Provider.DoSomething
End Sub

Render New ProviderA


Later you can create another class such as ProviderB and pass an object.
Basically you are on your won to ensure that both object expose the same
set
or methods/properties...
 

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

Forum statistics

Threads
474,146
Messages
2,570,831
Members
47,374
Latest member
anuragag27

Latest Threads

Top