Solved this.
Using the "ugly" way, but it works.
I let the Lock object in my support library take a optional parameter of the
HttpContext
Then the ASP.NET sends in the HttpContext, which then is sent to the routine
that shows waiting information, now I can send text information back to the
user.
Windows application isnt affected because it will not have any Httpcontext
to send into the function.
- Fredrik
"Fredrik Melin" <mel@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:aZOdnRwcdI0bBi6iRVn-jw@giganews.com...[color=blue]
> The threads are already there, because in the Windows environment, the[/color]
user[color=blue]
> get options to cancel or add more wait time, so the functionallity is
> already there, thats why I wanted the nice display for the web as well,
> simular to what I already have in the Windows enviroment.
>
> So, I really want to get it to work with the ASP.NET via a delegate or[/color]
some[color=blue]
> other callback method.
>
> - Fredrik
>
> "Dmitriy Lapshin [C# / .NET MVP]" <x-code@no-spam-please.hotpop.com> wrote
> in message news:uGkH4QfqDHA.2488@TK2MSFTNGP09.phx.gbl...[color=green]
> > Hi,
> >
> > There are two approaches:
> >
> > 1. A simple one.
> >
> > Do a quick test whether the order is locked and render a simple page[/color]
> saying[color=green]
> > "Please try again in a few minutes" if the order is indeed locked.
> >
> > 2. A more complex one.
> >
> > Do a quick test whether the order is locked. If this is true, render a[/color]
> page[color=green]
> > saying, "Please wait while the order is released...." which would[/color][/color]
refresh[color=blue][color=green]
> > itself, say, every 10 seconds or so through the <META NAME="Refresh">[/color][/color]
HTML[color=blue][color=green]
> > tag. Once the order has been released, process it and render another[/color][/color]
page[color=blue][color=green]
> > saying "Processing complete".
> >
> > No need for threads and delegates :-)
> >
> > --
> > Dmitriy Lapshin [C# / .NET MVP]
> > X-Unity Test Studio
> >
http://x-unity.miik.com.ua/teststudio.aspx
> > Bring the power of unit testing to VS .NET IDE
> >
> > "Fredrik Melin" <mel@n.o.spam.dacsa.net.remove.as.needed> wrote in[/color][/color]
message[color=blue][color=green]
> > news:nLOdnX9ET7hF7S6iRVn-jg@giganews.com...[color=darkred]
> > > Same problem that I had before, diffrent approach..
> > >
> > > In my application at order-creation, the user might encounter that the[/color]
> > item[color=darkred]
> > > he is trying to order is locked by another user, and he have to wait[/color][/color][/color]
up[color=blue]
> to[color=green][color=darkred]
> > > 45 seconds for it to release.
> > >
> > >
> > > Now, In my windows application that is no problem, I simply call a[/color][/color]
> dialog[color=green][color=darkred]
> > > box in a new thread, that show the information, everything works[/color][/color][/color]
great.[color=blue][color=green][color=darkred]
> > >
> > > Ok, for a ASP.NET application the problem starts, because the new[/color][/color][/color]
thread[color=blue][color=green][color=darkred]
> > > created does not have access the context, and therefor cannot write[/color][/color][/color]
any[color=blue][color=green][color=darkred]
> > > "waiting" information to the user.
> > >
> > > What I need to do is, somehow send in a reference to the Lock object[/color][/color][/color]
of[color=blue][color=green]
> > the[color=darkred]
> > > "wait handler function", so it will call it in a new thread, but the[/color]
> > actual[color=darkred]
> > > 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[/color][/color][/color]
it[color=blue][color=green]
> > dont[color=darkred]
> > > know where the wait method is created, if no-one sending a reference[/color][/color][/color]
to[color=blue]
> a[color=green][color=darkred]
> > > wait method to the lock object, it will generate an error (or just[/color][/color]
> simply[color=green][color=darkred]
> > > skip the wait information stage)
> > >
> > > So I need to send in a "Address Of" to the lock object, and it will[/color][/color][/color]
then[color=blue][color=green][color=darkred]
> > > start that procedure in a new thread.
> > >
> > > All delegates samples Ive seen, you have the caller of the function in[/color][/color]
> the[color=green][color=darkred]
> > > same class as the function that does the delegated procedure, but can[/color][/color][/color]
it[color=blue][color=green]
> > be[color=darkred]
> > > done the way I describe above?
> > > Or am I on the wrong road? (maybe even in the wrong city :-/ )
> > >
> > > Regards
> > > Fredrik Melin
> > >
> > >[/color]
> >[/color]
>
>[/color]