Subject: how to get message displayed on web page from xmppClient_OnMessage event
Hi All,
I must be missing something so hoping you can help.
I can successfully send and receive messages but when the xmppClient_OnMessage event is raised with my incoming message how can I display this message on my web page? I see there is another way to do it with SignalR but is this the only way? I am working with a database and lots of server side code so doing all the connections etc on the client side will be tough. A basic example of what i am trying to achieve is.
and on the ASPX
But the div "message" never gets updated with the incoming message even though it looks like it is being assigned. Same if I try any other type of control.
Any help appreciated.
Thanks
I must be missing something so hoping you can help.
I can successfully send and receive messages but when the xmppClient_OnMessage event is raised with my incoming message how can I display this message on my web page? I see there is another way to do it with SignalR but is this the only way? I am working with a database and lots of server side code so doing all the connections etc on the client side will be tough. A basic example of what i am trying to achieve is.
- //login
- protected void Button1_Click(object sender, EventArgs e)
- {
- xmppClientObj = new XmppClient { XmppDomain = "mydomain.com.au", Username = "user@mydomain.com.au", Password = "mypassword" };
- SetLicense();
- xmppClientObj.OnBeforeSasl += new EventHandler<Matrix.Xmpp.Sasl.SaslEventArgs>(xmppClient_OnBeforeSasl);
- xmppClientObj.Open();
- xmppClientObj.SendPresence(Show.chat, "Online");
- }
- //receive message and assign body to div so we can see it
- private void xmppClient_OnMessage(object sender, MessageEventArgs e)
- {
- message.InnerText = e.Message.Body.ToString();
- }
and on the ASPX
But the div "message" never gets updated with the incoming message even though it looks like it is being assigned. Same if I try any other type of control.
Any help appreciated.
Thanks