Please have a look at http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-getting-started-with-signalr-20-and-mvc-5
You will notice you are binding your JavaScript client object each time the button is clicked which most likely is causing issues. Recommend having a look at how the example at this URL instantiates the client side and go from there. Notice they perform the $.connection.hub.start() in document ready, not for each chat request
Is the problem with declaring the same variable name notifier in both the button click event and in global scope? Depending on where your code sits in the DOM, you should be able to just change the line in setnotification client to notifer.server.hello to get it to work. Just call the global notifier declared in your DOM. Don't reestablish a connection This could work as just a simple example:
<script type="text/javascript">
var notifier = $.connection.notificationHub;
notifier.client.helloEveryone = function (msg) {
$('#chatWindow').text(msg);
});
$(function(){
notifier.start().done(function(){
$("#setnotification").click(function(){
notifier.server.hello('World!');
});
});
});
</script>