如何在mvc 4中使用signalIR创建实时聊天? [英] How to create Live chat using signalIR in mvc 4?

查看:159
本文介绍了如何在mvc 4中使用signalIR创建实时聊天?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

namespace Chatapp
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            RouteTable.Routes.MapHubs();
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }
    }
}























////我收到错误RouteTable.Routes.MapHubs();这一行如何纠正这个错误请帮助我....












////I got the error RouteTable.Routes.MapHubs(); this line How to rectify this error please help me....

推荐答案

您可以参考以下链接,使用MVC 5向客户端广播消息:



在MVC 5中使用SignalR
You can refer the following link to broadcast the message to clients using the MVC 5:

SignalR Use in MVC 5


这篇关于如何在mvc 4中使用signalIR创建实时聊天?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆