F
Fredrik Melin
Same problem that I had before, diffrent approach..
In my application at order-creation, the user might encounter that the item
he is trying to order is locked by another user, and he have to wait up to
45 seconds for it to release.
Now, In my windows application that is no problem, I simply call a dialog
box in a new thread, that show the information, everything works great.
Ok, for a ASP.NET application the problem starts, because the new thread
created does not have access the context, and therefor cannot write any
"waiting" information to the user.
What I need to do is, somehow send in a reference to the Lock object of the
"wait handler function", so it will call it in a new thread, but the actual
function is made by the ASP.NET page.
Delegates huh?
In other words:
You have the lock object, it knows it will call "Wait" function, but it dont
know where the wait method is created, if no-one sending a reference to a
wait method to the lock object, it will generate an error (or just simply
skip the wait information stage)
So I need to send in a "Address Of" to the lock object, and it will then
start that procedure in a new thread.
All delegates samples Ive seen, you have the caller of the function in the
same class as the function that does the delegated procedure, but can it be
done the way I describe above?
Or am I on the wrong road? (maybe even in the wrong city :-/ )
Regards
Fredrik Melin
In my application at order-creation, the user might encounter that the item
he is trying to order is locked by another user, and he have to wait up to
45 seconds for it to release.
Now, In my windows application that is no problem, I simply call a dialog
box in a new thread, that show the information, everything works great.
Ok, for a ASP.NET application the problem starts, because the new thread
created does not have access the context, and therefor cannot write any
"waiting" information to the user.
What I need to do is, somehow send in a reference to the Lock object of the
"wait handler function", so it will call it in a new thread, but the actual
function is made by the ASP.NET page.
Delegates huh?
In other words:
You have the lock object, it knows it will call "Wait" function, but it dont
know where the wait method is created, if no-one sending a reference to a
wait method to the lock object, it will generate an error (or just simply
skip the wait information stage)
So I need to send in a "Address Of" to the lock object, and it will then
start that procedure in a new thread.
All delegates samples Ive seen, you have the caller of the function in the
same class as the function that does the delegated procedure, but can it be
done the way I describe above?
Or am I on the wrong road? (maybe even in the wrong city :-/ )
Regards
Fredrik Melin