I am trying to create a chat application using signalR using VS2012 web in a website.
But its showing me error like this:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:50780/WebApplication1/WebApplication1/signalr/hubs
Uncaught TypeError: Cannot read property 'client' of undefined
I have added RouteTable.Routes.MapHubs(); to Global.asax
But why should its showing me this error when its opening for other's system.
On the page where you're including signalr/hubs:
Change your script tag to look like this:
<script src="~/signalr/hubs"></script>
#drch's answer is also correct (if you're making that mistake) but the more common issue I see is people just doing "signalr/hubs" in their script tag and then the hubs url is then incorrect (in some circumstances).
Ultimately the hubs url resides off of the SignalR endpoint so doing a "~/signalr/hubs" makes the path app relative which should ensure that it retrieves the hubs.js from the correct url.
I know, that I'm late, but for smbd who will finding answers:
I've resolved the problem by registrate .Net frame work to IIS.
Do next steps into console (Win+R):
cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe –i
Source
Related
I am using plesk'shared hosting server to host my website. Constantly getting ViewState MAC failed error
Plesk won't be able to provide any Machine Key. As it is shared hosting.
I have also attached the screenshot. please help.
Earlier This issue was coming in one page only. I have resolve it by converting it to JavaScript and ajax call in order to Stop AutoPostBack.
But now this is coming in many pagaes.
Add following link in your web.config file.
Above line should be included within section.
OR
if you don't want this solution to implemented on project level then you can add these attribute to the page(Top most line of HTML view) directive of the page which is creating issue.
That means you have to add enableEventValidation="false" viewStateEncryptionMode="Never" in page directive.
I added WebResource.axd (empty file) manually in production environment (IIS7 and Windows Server 2008) after chrome and firefox was giving error 404 for WebResource.axd. And now it is working fine, even with parameters. I am not sure why ASP.NET generating this script in final render result (no problem with VS2008), but now it is working. I want to know, is there any security implications other than what normally associated with WebResource.axd as it is in root directory?
Thanks
I also had this issue recently, after a code change WebResource.axd stopped working for my site. Basically, it exposes dynamic resources over http. For a longer explanation visit:
Just where is webresource.axd?
Typically, what happens is that one of the dynamic resources being requested has failed, but the resource name is encrypted. This blog post will help you decrypt the name, use it and the query string of your failing webresource.axd?___ request to figure out where the error is coming from.
Telerik webresource troubleshooting
When I am trying to add SignalR in our existing web application (with MVC 4) I am getting below error message on page load.
Message: Unable to get value of the property 'signalR': object is null or undefined
URI: http://dev.casino.bwin.com/signalr/hubs
I tried to navigate to signalr/hubs jquery and it seems to be working fine as my client hub class is available in the javascript.
Any pointers on what i might be doing wrong.
You should be including "Scripts/jquery.signalR-1.0.1.min.js" after jQuery but before the "/signalr/hubs" script.
Look at Javascript + HTML Client section of http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client for reference.
I'm getting the dreaded "Microsoft JScript runtime error: 'Sys' is undefined" error while trying to develop a site in ASP.NET on .NET framework 4.0. This was working fine until I tried programmatically adding items to a menu, and this started happening. While debugging, I pointed Fiddler at my app and found that the request for the WebResource.axd is returning successfully (code == 200), but the response text is the whole html page and NOT the javascript that it is supposed to be returning, and this is why Sys is undefined.
What's going on here? Any help much appreciated. Thanks.
Solved, thanks to this. I'm using ASP.NET Routing, and I was routing root level requests like http://www.mysite.com/{PageId}, and this matching pattern is so general that it was also matching the request for /WebResource.axd, and that's why the page request for the axd file was being routed to an aspx page instead of the usual handler. Not what I would have expected, but I can see the logic.
The fix is to tell the routing system to ignore this particular kind of request:
RouteTable.Routes.Ignore("{resource}.axd/{*pathInfo}")
I cannot get the URL rewriting module to work on my local PC (vista x86)
i set up a new rule using the 'user friendly url' template.
a picture rather than 1000 words....
(the image contains 3 shots - creation, config and pattern test)
http://www.sk8loc8.com/rewriteIssue.jpg
so now that is setup if i request 'localhost/iisrewriteurl/content/5 i should see my content.aspx page.
nope...
Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Detailed Error Information
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL IISRewriteURL/content/5/
Physical Path C:\Users\Guy\Documents\Visual Studio 2008\Projects\IISRewriteURL\IISRewriteURL\content\5\
Logon Method Anonymous
Logon User Anonymous
When i go back into the rule itself and test the patterns that IIS made for me, they do not work..
I have tried adding a wildcard script map under the handler mappings section but this makes no difference.
Has anyone seen this type of behaviour before? Or am i missing something very simple?
If you test the pattern you dont need the Host
I always just create Blank Rules and not had a problem that way since not sure if it matters though. I cannot discover why that rewrite wouldnt work perhaps other rules are blocking it?
Alternatively you may have a look at Helicon Ape product that emulates Apache modules behavior on IIS7. It has simpler syntax and Helicon Ape Manager automatically checks the syntax of the rules you write.