4

I'm trying a very simple demo of SignalR but getting the infamous "undefined" error on the following line in my javascript:

var myHub = $.connection.myHub;

MyHub.cs is as follows:

public class MyHub : Hub
{
    ...
}

Most of the examples I've seen so far are MVC or web application projects. With those, MyHub.cs would be placed in the App_Code folder. However, our project is a website project and we can't change it to a web application.

What can I do to make it work?

1 Answer 1

5

It turned out that I missed the following in web.config:

<modules runAllManagedModulesForAllRequests="true">

And yes, you can absolutely use SignalR in a website project.

1
  • Well I found out that I need to place it inside <system.webServer>, but the same error shows up.
    – Arman
    Commented Dec 1, 2013 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.