2
我特林利用簡單SignalR樣品,並從原因,我從以下獲得404碼 - 根據SignalR不工作生產服務器上
<script src="<%= ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script>
我檢查了SignalR文檔和改變了我的web.config到什麼暗示仍然我得到那404狀態代碼。
我的代碼如下 -
的Web.Config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<httpRuntime/>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
</system.webServer>
</configuration>
的Default.aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-0.5.3.min.js" type="text/javascript"></script>
<script src="<%= ResolveUrl("~/signalr/hubs") %>" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
//var connection = new Connection("127.0.0.1");
// Proxy created on the fly
var chat = $.connection.chatt;
// Declare a function on the chat hub so the server can invoke it
chat.addMessage = function (message) {
$('#messages').append('<li>' + message + '</li>');
};
$("#broadcast").click(function() {
// Call the chat method on the server
chat.send($('#msg').val());
});
// Start the connection
$.connection.hub.start();
});
</script>
</head>
<input type="text" id="msg" />
<input type="button" id="broadcast" value="broadcast" />
<ul id="messages">
</ul>
</html>
請協助。