Files
GMW/GMW-RT/TestSend.aspx.cs
T
2014-04-02 20:02:56 +02:00

32 lines
913 B
C#

using Microsoft.AspNet.SignalR;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GMW_RT
{
public partial class TestSend : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSendAll_Click(object sender, EventArgs e)
{
// mando segnale a tutti i clients...
#if false
var context = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
context.Clients.All.Send("Admin", "stop the chat");
#endif
var hubContext = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
hubContext.Clients.All.Send("Admin", "stop the chat");
txtMessage.Text = "";
txtMessage.Focus();
lblMess.Text = "Messaggio inviato!";
}
}
}