Results 1 to 7 of 7

Thread: [RESOLVED] Equivalent to Invoke() in ASP.NET?

  1. #1
    Addicted Member
    Join Date
    Aug 10
    Posts
    163

    [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?
    Last edited by acrym; Jul 17th, 2012 at 05:56 PM.

  2. #2
    King of sapila
    Join Date
    Oct 06
    Location
    Greece
    Posts
    3,511

    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.
    Slow as hell.

  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,733

    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

  4. #4
    Addicted Member
    Join Date
    Aug 10
    Posts
    163

    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.

  5. #5
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,733

    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

  6. #6
    Addicted Member
    Join Date
    Aug 10
    Posts
    163

    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!

  7. #7
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 04
    Location
    The Granite City
    Posts
    21,733

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •