[RESOLVED] Equivalent to Invoke() in ASP.NET?
Hi, I have an ASP.NET application using an XMPP client. The client has an event handler for messages received, and I think it runs in a new thread. I want to update a UI control in this event, but was surprised ASP.NET doesn't have an Invoke() or BeginInvoke() method? What is the equivalent I could use?
Re: Equivalent to Invoke() in ASP.NET?
I believe since the web app is stateless the whole idea of threading and invoke is somewhat useless(please correct if you like).I think the closer you can go to achieve something "similar" is with web services and a jquery timer to the client.
Re: Equivalent to Invoke() in ASP.NET?
Hello,
Is it possible that you can provide some more details about what exactly it is that you are trying to achieve.
Having looked up XMPP, I found this:
http://xmpp.org/xmpp-software/clients/
Which suggests that you are trying to do some form of chat client. Is that correct? If so, you may want to have a look at using SignalR.
Gary
Re: Equivalent to Invoke() in ASP.NET?
Hi Gary,
Yes I am trying to build a chat client. SignalR looks interesting, I will look into it, thanks :)
To Gary and sapator - I've managed a pseudo-solution by storing a result from my async operation in a Session.Item, and calling that item from the client by a Timer control. Thanks for the help though.
Re: Equivalent to Invoke() in ASP.NET?
Hey,
That approach is certainly a usable one, however, that approach means a lot of chatter between the server and client.
SignalR, when possible, uses a direct socket between the server and client, making it the perfect medium to do this.
Take a look at the sample SignalR chat application here:
http://jabbr.net/
Gary
Re: Equivalent to Invoke() in ASP.NET?
Implementing a new SignalR chat application right now. It works great, and I highly recommend it! Thanks Gary! :)
Re: [RESOLVED] Equivalent to Invoke() in ASP.NET?
Woo hoo!! Glad to hear it!
If this site is public facing, I would love to check it out when it is completed!
Gary