SignalR with Routing in ASP.NET Website returns 404

knaa

New Member
I am using SignalR and testing it on an ASP.NET website. I've installed all the necessary files via NuGet and the basic sample works ok when I use:\[code\]<script type="text/javascript" src="http://stackoverflow.com/sample_website/SignalR/Hubs"></script>\[/code\]My problem starts when I decide to use a connection like this:\[code\]var c = $.connection("/userCounter");\[/code\]and in the Global.asax I have the following code:\[code\]protected void Application_Start(object sender, EventArgs e) { RouteTable.Routes.MapConnection<UserCounterConnection> ("userCounter", "userCounter/{*operation}"); }\[/code\]The other parts of the code are exactly as give in this video.I run the page and the browser shows the url: localhost:13664/sample_website/HitCounters2.aspxError: When I run the demo I get a 404 error in the GET call (not in the page itself, just in the specific GET call to the server). The GET call is for the URL:\[code\]localhost:13664/userCounter/negotiate?_=1348753507767\[/code\]The first thing I've notices is that the URL should probably be\[code\]localhost:13364/sample_website/userCounter/...\[/code\]But even when I change the URL and paste in the browser I get Error 404, so I think that even when correcting the routing in the global.asax I might still get that 404 error (I don't know how to change the routing to add that extra path to the route, if of course it's needed or not, I don't know)All I want is for SignalR to work the same in the video, but in website, not MVC Project. The first sample worked great but this one with the routing doesn't. I don't know how to solve this and hope that some of you might help. Thanks.
 
Back
Top