How to use SIGNALR 2.0

Source: Internet
Author: User
Tags html page jquery library

This is the Microsoft Official SIGNALR 2.0 tutorial Getting Started with ASP.net signalr 2.0 series translation, this is the fourth article: starts to use SIGNALR 2.0

Original: Getting Started with SIGNALR 2.0

PS. The previous article upgraded from SignalR1.0 to 2.0 skipped ... Only a few steps, interested students can go to see for themselves.

Overview

This tutorial shows you how to use SignalR2.0 to build a browser-based chat room program. You will add the SIGNALR library to an empty asp.net Web application, create a hub (Hubs) class for sending messages to the client, and create an HTML page where users can send and receive chat messages on the page. For how to create a chat room in a MVC5 environment, see Getting Started with SIGNALR 2.0 and MVC 5.

SIGNALR is an open-source. NET Library for building Web applications that require real-time user interaction or real-time data updates. such as social applications, multi-user online games, business collaboration, news, weather, finance or update applications. These are often used as real-time applications.

SIGNALR simplifies the process of building real-time applications. It includes a ASP.net server library and a JavaScript client library that makes it easier to manage client to server-side connections and push content updates to clients. You can add the SIGNALR library to an existing ASP.net application for real-time functionality.

This tutorial will demonstrate the following SIGNALR development tasks:

Add signalr library to asp.net Web application

Set up a hub class to push updates to the client

Build one. NET open Web Interface (Owin) startup class to configure the application

Use the SIGNALR jquery library to send and display update messages in a Web page

The following screenshot shows the chat application running in the browser, and every new user who joins the chat room is free to speak.

Set up the project

This section explains how to create a chat room by using the VS2013 and SIGNALR 2.0 libraries to create an empty ASP.net Web reference program and add SIGNALR to it.

1. Create a new Web application in VS2013.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.