asp.net - SignalR User NullReferenceException -


i've got code

using microsoft.aspnet.signalr;  namespace chat22 {     public class chathub : hub     {         public void send(string message)         {             string name = context.user.identity.name;             // call broadcastmessage method update clients.             clients.all.broadcastmessage(name, message);         }     } } 

but when try send message, nullreferenceexception context.user.identity.name

but works fine when set username in js code, , add name parameter in function, getting context name doesn't work.

i tried on both local , published on web

how can names?

thanks

answer add authorization
http://www.asp.net/signalr/overview/security/hub-authorization#requireauth


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -