Tagged Questions
1
vote
2answers
31 views
Web API Route not recognized
I have :
[RoutePrefix("teamone/players")]
..........................
[HttpPost("{key:regex([A-Za-z0-9]{32})}/AccessToken", RouteName = "MakeToken")]
public HttpResponseMessage ...
0
votes
0answers
9 views
How to check if a HTTP address is responding without throwing exceptions?
WebClient and HttpWebRequest throw WebException when connecting to an unavailable address. I've seen some techniques that use BeginGetResponse that avoid throwing exceptions in this case. But they ...
0
votes
0answers
22 views
WCF REST not able to resolve uri
I have a Wcf rest (3.5 frmaework). When I access https //addres of ip /test.svc/data/123. It works but when I access through load balancer (https //domainname.com/test.svc/data/123) it says resource ...
0
votes
0answers
32 views
Jquery Ajax webservice call works on iPad and S3 browsers but not in desktop browsers
I have an issue here that I´m trying to make a jquery ajax call to a web service and although It works on my iPad and S3 browsers, I´m getting a 404 http status code when trying to access from my ...
0
votes
0answers
241 views
Deploy ASP.net MVC project to IIS and redirect to login.aspx
I have an ASP.NET MVC 4 project that I just deployed to IIS. When I tried to browse the web from the IIS, it always redirect to login.aspx (which I believe I have no such file on my project, I tried ...
0
votes
0answers
22 views
Server.Execute for 404 Error
This is my code for 404 Error.
Exception exc = Server.GetLastError();
if (((HttpException)exc).GetHttpCode().ToString().Contains("404"))
{
HttpContext.Current.Response.StatusCode = 404;
...
2
votes
0answers
106 views
Visual Studio REST Unit Tests returning 404
Using the local development web server (Cassini) in Visual Studio 2012 I receive consistent 404 Not Found responses from an HttpClient during unit test execution. Hitting the same local URI in fiddler ...
0
votes
1answer
370 views
IIS throwing HTTP 404 not found but resource exists. Requested URL also changing automatically.!
I'm facing a really weird scenario here with my local IIS. I have hosted multiple sites in the default website in my local IIS. One of them has the login page. From the login page, I'm redirecting the ...
0
votes
0answers
208 views
URL routing fails if contains %2B
I'm making a service call which contains string variables that can have special characters. As such I encode the strings to be URL safe. Or at least try. I convert them on the iPhone using ...
1
vote
1answer
68 views
How Can I Pass a 404 Error from Model in MVC 4 to View
In my RouteConfig.cs file I have the following to handle my Url requests;
routes.MapRoute("Product", "products/{Url}",
new { controller = "product", action = "index" });
In my model, I check that ...
0
votes
0answers
67 views
Error 404 for long running WCF RIA Services call
We have a RIA Services call that only passes a couple of parameters, however it can take an extended period of time to process (e.g. 20+ minutes) When it hits around the 10 to 15 minute mark, we get ...
0
votes
1answer
96 views
Webresource.axd and SciptResource.axd won't load on server
I am just starting out with asp .net and I am a little bit lost trying to figure it all out and I was hoping someone here would be kind enough to help me.
Using VS12, I have selected a new ASP .Net ...
0
votes
1answer
204 views
HttpWebRequest/Reponse return cookies sent
This question is related to the following but different enough that I think it warrants its own thread.
XmlDocument.Load() certain url's return 404 not found
I am getting a 404 Not Found error ...
0
votes
0answers
245 views
XmlDocument.Load() certain url's return 404 not found
I am pretty stumped on this one..I have a program that parses xml files that are made available through the SEC's EDGAR database using XmlDocument.Load()
ex: ...
0
votes
1answer
292 views
file upload in asp.net shows 404 error
I have already set the file limits in C# file so that it checks for the file size
int filesize = personalFileUpload.PostedFile.ContentLength;
if (filesize <= 26214400)
{
}
also in my web ...
1
vote
1answer
612 views
How to catch 404 WebException for WebClient.DownloadFileAsync
This code:
try
{
_wcl.DownloadFile(url, currentFileName);
}
catch (WebException ex)
{
if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null)
if ((ex.Response as ...
0
votes
1answer
327 views
Works for GET, not for POST (404 error)
I have a WebApi controller ServicesApiController in my MVC4 project with a signature like so:
[Authorize(Roles = "sysadmin,Secretary")]
[AcceptVerbs("GET", "POST")]
public IEnumerable<Stock> ...
1
vote
2answers
2k views
MVC 4 - LogOff controller action giving 404 not found
I'm just wrapping up a college project, I'm not sure if I've been staring at my computer for too long and am missing something obvious, but when I try to log a user out, I'm getting a 404 not found ...
0
votes
0answers
123 views
C# WebRequest 404, Works in Browser (form post)
I have been trying to make a webrequest using the following and when I access that through C# code, it sometimes 404's. Depending on how the JSESSIONID Cookie is returned, it will either work or it ...
0
votes
1answer
229 views
Ajax.ActionLink giving 404 not found error
I have a partial view that has an Ajax.ActionLink that when clicked should replace the view (target DIV) with another partial view that allows a user to upload an image. I have several of these on the ...
0
votes
1answer
35 views
Custom 404 page to find out the link
I am looking to create a 404 page that can retrieve the page URL. I have tried using UrlReferer but this returned null. If I can find the URL I can create the relevant redirect.
Thanks
0
votes
0answers
95 views
Error 404 while executing GetRequest() for a listing directory on FTP with proxy
I can tell you in advance that my URL is ok. Recently we've moved our server applications and the urrent systems have a nice proxy.
So, i think that the proxy is being the problem, but no idea in how ...
7
votes
2answers
1k views
404 error on signalr/hubs and on jquery scripts
I've just started using SignalR with C#, seems intresting.
I've created an ASP.NET Empty Web Application and followed the tutorial mentioned below
I found Getting Started with SignalR tutorial on ...
2
votes
1answer
208 views
Umbraco 4.11.3 : Client side form upload (multipart/form-data) gives 404
I'm using umbraco with extensionless urls.
I've inserted a simple piece of HTML in one of my masterpages (en/test) :
<form method="post" enctype="multipart/form-data">
<input ...
0
votes
1answer
161 views
How to detect trusted sites using HttpWebRequest in webservice?
I have a console application for the 2.0 framework in C#, using vs
2005. This is weird, the exact same code I have worked on both my pc and the server(using webservice).
When I execute ...
1
vote
1answer
563 views
Why is my application returning the IIS 404 page on my dev environment but not test or production?
OK, so I develop my application locally at http://dev.myapplication.com (using hosts file for the DNS), and then I have http://test.myapplication.com and http://www.myapplication.com.
In IIS 7 ...
0
votes
1answer
132 views
MVC 404 Errors - Still New
So, I'm getting a 404 error on my current MVC project on submit. I'm new to MVC, so I'm likely doing something exceptionally stupid. Here's the relevant code...
<%@ Page Title="Pies" Language="C#" ...
0
votes
2answers
218 views
Azure Table Storage: 404 Error during execution of Insertion
I am writing a query to insert 300k rows to a table, i get a 404 File or Directory not found error during the execution of insertion. i am a noob to azure so i may have written some stupid code
I ...
0
votes
4answers
506 views
How to Skip HttpWebResponse 404
Hi i have a program thats looking on some pages
for (int i=1; i < 1000; i++)
{
string id = i.ToString();
string url_source = get_url_source("http://mysite.com/"+id);
}
and a method
...
1
vote
1answer
266 views
C# HttpWebResponse GetResponse throwing 404 Error because it needs to be redirected
I am currently designing an application that reads ID's from a text file and then adds it to the URL address... so urlhere is actually www.website.com/ID. The only problem is that the website ...
0
votes
2answers
343 views
ASP.NET 404 Handling Code Works Locally but Not on Server
I'm hosting my site on DiscountASP.NET. I've been having problems with my 404 error handling recently because the client is not being sent the 404 status code, and I can't figure out why it started ...
1
vote
1answer
196 views
Asp URL Rewrite on Multiple Domains
I'm currently making a link shortening service on my hosting package. I'm using URL rewrites to do this. An example of this working is here - dysign.co.uk/xBbYPL. This redirects you to Google.de. I'm ...
0
votes
1answer
101 views
Avoid handle 404 on other requests than main
I used the method below in the EndRequest method from global asax. I get a HTTP 404 error even from image request or other requests. The point is that I want to check only for the first request/main ...
1
vote
1answer
158 views
How to 'retrieve' browser-typed 404 url and make it auto redirect on c#
I have a c# web application on i.e. http://mysite.com
User opens his browser and types http://mysite.com/anywrongpath
Which I want to do is to get the "exact" url ( /anywrongpath ) and THEN redirect ...
4
votes
1answer
76 views
Is there a way of differentiating between Custom error pages and default error pages for webpages?
I am just wondering if there is a method to test whether a 404 error page which is returned from a server is the default error page for that server (I'm mainly thinking about the default 404 page ...
3
votes
1answer
674 views
How do you override the default 404 page in ServiceStack?
I am using ServiceStack and have my own handlers in for any exceptions thrown which works beautifully. However, I cannot seem to find out how to override the default 404 error page returned from ...
0
votes
2answers
167 views
Change default view folder for custom Http404 error page
I want to custom error pages in my asp.net mvc3 website.
So, I found this very useful post: Custom error pages on asp.net MVC3 and it works well
However, my Http404.cshtml file isn't in the Views ...
2
votes
3answers
643 views
How to add additional query string parameters when 404 redirect occurs
We are currently using a custom error page for 404 errors for our Web App. When the redirect occurs aspxerrorpath contains the path the user was trying to access. Is it possible to catch the error in ...
2
votes
3answers
134 views
Return 404 for other IP addresses other then mine in ASP.NET
I am testing my ASP.net website online, but I don't want it to be accessible to anyone, just from my IP address. How I can return 404 or something for people that aren't from my IP address. Developing ...
2
votes
2answers
1k views
Custom 404 Error Messages ASP.NET Visual Studio
Anyone know how to set the custom 404 Error pages that the Visual Studio Development Server uses?
I know how to get it to work if I set is as a local IIS server and then setup the custom 404 pages ...
1
vote
2answers
235 views
Should a ModelBinder throw a 404 Exception
I am starting to switch over my Controllers to use model binders for GET actions instead of using an int parameter. My normal controller GET action looks like the following ...
public ActionResult ...
0
votes
2answers
201 views
404 error in C#
How can I handle manually the 404 error in C#?
I want to check some conditions in 404 error and then redirect it to the proper page.
I know the web.config settings, but you can't check conditions in ...
1
vote
2answers
166 views
Image caching issue by using files in ASP.NET
I am facing a problem with Image caching by using files in ASP.NET. My detailed solution is:
For 1st request: I check the image file not exists and write the image file into hard disk. After that ...
1
vote
3answers
1k views
Correctly send user to 404 if dynamic content is not found (ASP.NET MVC)
I have implemented 404 handling for the general case in ASP.NET MVC 3, for when a controller/view is not found. But how should it be handled inside the controller if the user is trying to access ...
2
votes
2answers
911 views
“404” for PUT method to WCF web service?
I have a PUT request which is returning a 404 error from my client, the code looks like this:
{
string uriupdatestudent = ...
4
votes
2answers
2k views
Why does HttpWebRequest throw an exception instead returning HttpStatusCode.NotFound?
I'm trying to verify the existence of a Url using HttpWebRequest. I found a few examples that do basically this:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(Url);
request.Method = ...
2
votes
2answers
2k views
Test WCF with JSON Response
I have a WCF Service that return a json. I want to test it using Fiddle (this is the application that is used in the tutorial i was following). The problem is that i get HTTP 404 error when invoking ...
0
votes
3answers
182 views
How do I get the HTTP response from a navigation to a page?
I have a scenario where I navigate to a test site, but for whatever reason (connectivity issues, etc), sometimes, the test fails because it couldn't reach the website. How do I ask for the HTTP ...
1
vote
0answers
1k views
“The remote server returned an error: (404) NOT FOUND”
Firstly, describe structure.
My solution contains:
WCF service project (with connection to DB via EF)
Windows Service project - host for WCF service
Client application (has Service references to ...
3
votes
0answers
332 views
When using a HttpHandler to handle 404s in .NET 4.0, how to determine the current path?
My app uses a HttpErrors rule in the web.config to redirect 404s to a custom HttpHandler:
<handlers>
<add name="MyHandler" path="/default.aspx" verb="*" type="MyHandler.HttpHandler" />
...