using System;
using System.Threading.Tasks;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(SignalR_UpdatePanel.Startup))]
namespace SignalR_UpdatePanel
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
HUB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
namespace SignalR_UpdatePanel
{
[HubName("hubUpdate")]
public class HubUpdate : Hub
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.AspNet.SignalR;
namespace SignalR_UpdatePanel
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
var hubContext = GlobalHost.ConnectionManager.GetHubContext<HubUpdate>();
hubContext.Clients.All.notify("Hello!");
}
}
}
I've tested it and it works for me on Chrome and IE. It doesn't work in Firefox but still the firefox is capable of broadcasting the message to other browsers but itself. Seems like a trasportation bug with the firefox.
None
0 Points
1 Post
Only Server To Client Test Don't Work
Nov 06, 2013 03:11 AM|lf_cruz|LINK
Why dont work?
STARTUP
HUB
ASPX
CS
signalr servertoclient server2client
All-Star
52711 Points
9668 Posts
MVP
Re: Only Server To Client Test Don't Work
Nov 09, 2013 08:14 PM|Ruchira|LINK
I've tested it and it works for me on Chrome and IE. It doesn't work in Firefox but still the firefox is capable of broadcasting the message to other browsers but itself. Seems like a trasportation bug with the firefox.
signalr servertoclient server2client
Please 'Mark as Answer' if this post helps you
Developer Tools Download | Windows 10 Videos | My Tech Blog