altri test x versione signalR

This commit is contained in:
Samuele Locatelli
2014-04-02 20:02:56 +02:00
parent 35c7e1aa4d
commit 792549dfd6
5 changed files with 109 additions and 0 deletions
+8
View File
@@ -85,12 +85,20 @@
<Content Include="Scripts\jquery-1.8.2.min.js" />
<Content Include="Scripts\jquery.signalR-2.0.3.js" />
<Content Include="Scripts\jquery.signalR-2.0.3.min.js" />
<Content Include="TestSend.aspx" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="ChatHub.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
<Compile Include="TestSend.aspx.cs">
<DependentUpon>TestSend.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="TestSend.aspx.designer.cs">
<DependentUpon>TestSend.aspx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
+18
View File
@@ -0,0 +1,18 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestSend.aspx.cs" Inherits="GMW_RT.TestSend" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox runat="server" ID="txtMessage" />
<asp:Button runat="server" ID="btnSendAll" Text="sendAll" OnClick="btnSendAll_Click" />
<asp:Label runat="server" ID="lblMess" Text="..." />
</div>
</form>
</body>
</html>
+32
View File
@@ -0,0 +1,32 @@
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!";
}
}
}
+51
View File
@@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GMW_RT {
public partial class TestSend {
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// txtMessage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMessage;
/// <summary>
/// btnSendAll control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSendAll;
/// <summary>
/// lblMess control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMess;
}
}
Binary file not shown.