MVC :: Static Content Returns A 500 Error?
Nov 16, 2010
I think I might be missing something obvious but I'm not sure. The other day I was trying to run throught the windows live ID domain verification process on my asp.net mvc site. Part of the process requires you to download a text file and put it in the root of your site which your domain points to. When I would click the verify button in the windows live app verification process it would fail. In a browser, I could hit the request the text file and get a 200, which puzzle me. I then used this site http://www.internetofficer.com/seo-tool/redirect-check/ to check for any redirection issues. Suprisingly when I enter in the url to check, in my case http://www.whatitcoststobeme.com/741KXPjf42zgZRnV6O1LsO92.txt, it returns a 500 error. I ran this same test against a non-MVC site and the verificaton process passed plus the redirection checker return a 200 ("direct link" on their site). The environment this was tested in was IIS7.
why this is happening with static content on a ASP.NET MVC site? I want to say it's something to do with the url routing handlers.
View 6 Replies
Similar Messages:
May 26, 2010
so I see these opinions/tutorials about serving static content to support views, from files that co-reside in directories with those views:http://forums.asp.net/p/1258895/2347379.aspx#2347379http://haacked.com/archive/2008/06/25/aspnetmvc-block-view-access.aspxIn the second article, Phil says view-adjacent static content was default-enabled at the time (over a year ago). Unfortunately, though, I reference:
[Code]....
and by default ASP.NET is trying to find it adjacent to my view, which (voila!) is disabled by default. Grr. :)What is the out-of-box IDE-assisted way to reference view-specific static content that doesn't require hardcoding directory tree structures into my path, and also doesn't require ALL of my assets to be in a single folder?Or, if I do it the "unpure" way like I'll probably do if I don't get other ideas (by modifying /Views/Web.Config HttpFileNotFoundHandler), should I block anything unsafe besides .ASCX, .ASPX, and .MASTER that is likely to show up in my views folder?
View 8 Replies
Oct 10, 2010
I have two aspx pages that both use the same master page. Master page is more or less the default from VWD 2010 web application (Site.Master).
So both page A and B have the same:
[Code]....
The difference when shown in web browsers is (tested on Chrome and Firefox) that PageB looks like it has one more blank row/space on top of the page. How is this possible?
View 2 Replies
May 31, 2010
I just did an audit of one of my web application page (built using ASP.Net and running on development server) using Google chrome's developer tool. One particular warning caught my eyes:
Serve static content from a cookieless domain (5)!
Here is my screen shot [URL] as well. I would like to know is it possible to avoid cookies for these kind of requests. I see that there is no cookie requests for javascript files as well. I it possible to avoid cookies in the header for these files as well? and why didn't the browser attach cookies for javascript files and attach for CSS and image?
View 1 Replies
Feb 24, 2011
I have a domain which is receiving quite a few hits per day and have been asked if I can serve the static content from a subdomain. As the site is quite extensive and already written, I was wondering if there is any way I can use URL rewriting to change:
www.example.com/image.gif
to
static.example.com/image.gif
I have a solution which works using 301 redirects but from what I understand, this is counter productive as 2 requests will have to be made per image. I don't really want to go through all the aspx pages and css to hard code the new url as it will cause problems further down the line - some parts of the site are still being developed and static content could change at any time. I tried using rewrite (as opposed to redirect) to change the url but it came out something like:
http://www.example.com/http://static.example.com/image.gif
How would you achieve this? I have full access to dns and the server (win 2008r2 / IIS 7.5) so can make any changes if url rewriting is not the answer.
View 1 Replies
Dec 19, 2010
when the server reboots, one route sometimes returns a 404 until the site is manually restarted. why is that? using mvc 3 rc1 and razor views.
View 16 Replies
Jun 10, 2010
I have a wcf service that randomly begins to fail when requesting the autogenerated javascript that wcf supports making. But I have no luck tracking down why. The js thing is part of the wcf featureset, so I dont know how it can suddenly begin to fail and be unable to work until IIS is recycled.
The http log gives me:
2010-06-10 09:11:49 W3SVC2095255988 myip GET /path/myservice.svc/js _=1276161113900 80 - ip browser 500 0 0
So its an error 500, and that is about the only thing I can figure out. The event log contains no information.
Requests to /path/myservice.svc works just fine. After recycling IIS it works again, and some days later it begins to fail until I recycle IIS.
<service
name="path.myservice"
behaviorConfiguration="b">
<endpoint
address=""
behaviorConfiguration="eb"
binding="webHttpBinding"
contract="path.Imyservice" />
</service>
...
<endpointBehaviors>
<behavior name="eb">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="b">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
I dont see any problems in the web.config settings either.
Edit:
Just to make it clear - It is the generation of javascript that fails, my code is never invoked. Calls to the service works just fine.
View 2 Replies
Nov 5, 2010
How to respect "Serve static content from a cookieless domain" page speed rule in IIS6?
View 3 Replies
Jul 28, 2010
I'm experiencing a really confusing error. Exactly every other time the page returns
ERROR [23000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Integrity constraint violation:uniqueness constraint violation (7518)and else it works nicely.
Here's the SQL:
SELECT SlsOrder.Orderdate, SlsLine.LineNum, CASE WHEN SlsLine.AllDelivered = 1 THEN 'X' ELSE '0' END AS 'AllDelivered', Item.ItemName, Item.TechName, SlsLine.IntDlvDate, SlsLine.OrderNum, SlsLine.ItemCode, SlsLine.Version, CEILING(SlsLine.Qty) AS 'Qty',
Item.QtyUnit, ROUND((SlsLine.Price*SlsLine.Qty),2) AS 'rowSum', ROUND(SlsLine.Price,2) AS 'Price', IFNULL(SysText.InfoText, '-') AS 'InfoText' FROM PUB.SlsLine INNER JOIN PUB.SlsOrder ON (SlsLine.OrderNum=SlsOrder.OrderNum) INNER JOIN PUB.Item ON (SlsLine.ItemCode=Item.ItemCode)
LEFT OUTER JOIN PUB.SysText ON (SlsLine.SlsLineKey=SysText.SysTextKey) AND SysText.NoteType = 'OrdConfRowE' AND SysText.ConsTxt = '' WHERE (SlsLine.OrderNum = '" & o & "') ORDER BY SlsLine.LineNum
View 2 Replies
Nov 2, 2010
I have a webservice (ASMX) which I have tested locally using built-in VS web server. It works fine in the Dev environment, and there was no configuration of anything in IIS for this kind of webservice to work.
Today when I deployed my site on the live server, I got a 500 error when the webservice is being called. The website doesn't work, and unfortunately the client did not test this on staging (same server)
Here's the sample call to my service.
$.ajax({
type: "POST",
url: 'http://www.mydomain.com/services/someservice.asmx/MyMethod',
data: "someid=564",
dataType: "xml",
success: function(msg){
}
In Firebug, http://www.mydomain.com/services/someservice.asmx/MyMethod returns error 500 internal server.
I called the service using jQuery AJAX, the live server is Windows Server 2008 Standard.
View 1 Replies
Nov 17, 2010
I bought a website a few years ago, hosted with WebHost4Life,. Since their migration their has been nothing but problems with my site, however, I am stuck because I don't have the knowledge to move it, have tried with no success. Anyway, recently I have been getting parser error messages, Webhost fixed them, and then it starts over again. It takes them weeks to get around to it and since its my livelihood, I can't afford for the site to be down for 5 days then running for one day. I've tried to contact the guy that built the site to no avail, he won't answer my emails.
why these parser errors keep happening. This is a recent thing from the past 2 months, never had this before. What can I do to stop it. it looks like the knowledge here is unreal, I'm in awe everytime I read your answers. BTW, heres my lastest parser error:
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls. Source Error:
[Code]....
View 2 Replies
Oct 12, 2010
I have a routine that submits a SOAP request using HttpWebRequest and WebResponse. If the SOAP Request fails the server sends back HTTP/1.1 500 Internal Server Error. When I trap the error I have yet to find a way to view the body of the reply which contains the fault code. Is there a way to retrieve the message body when the server returns a 500 internal Server Error? In body of the reply which I am not able to retrieve.
faultstring xml:lang="en-US" Specified argument was out of the range of valid values.
View 1 Replies
Nov 29, 2010
In my asp.net web site I have custom error pages defined as following in my web.config file.
<customErrors mode="On" defaultRedirect="~/defaulterror.htm" >
<error statusCode="404" redirect="~/404.htm" />
When file is not found it correctly display 404.htm page but the issue is when I do Fiddler trace it returns 302 as HTTP status code.This is a big issue for search engine page indexing due to this lot of broken links still have been indexed recently because of this in my web site. how can I prevent returning 302 as HTTP status code for file not found errors and return 404 for file not found errors.I am using asp.net 3.5.
View 3 Replies
Feb 7, 2011
I have a log-in panel that when a user is logged in will show a Log Out button. Only problem is when I go to debug I get the error message:
"error BC30506: Handles clause requires a WithEvents variable defined in the containing type or one of its base types."
This is my back-end code:
[Code]....
And this is the front-end:
[Code]....
The log-in button works fine and I was just wondering if any of you could spot what is wrong as it looks like it should work perfectly as it is the same as the log in button.
View 3 Replies
May 10, 2010
Is it safe to access asp.net session variables through static properties of a static object?Here is what I mean:
public static class SessionHelper
{
public static int Age
{
get
{
[code]...
Is it possible that userA could access userB's session data this way?
View 2 Replies
Mar 10, 2011
I have a problem with the package manager. I can't install packages because the manager returns ann error with the link.
View 1 Replies
Jan 29, 2010
I searched many posts in this forum and could not find good answer ,I almost tried all the suggestions in this forum for similar issue,So please don't say there are many posts to refer in this forum.Iam trying to fax a pdf document which is auto generated by the ItextSharp tool.Iam using ItextSharp PdfWriter for generating a pdf ,which writes the pdf in a file.Until this point everything is ok,I get the pdf document as expected.What would like to do is to send this pdf via email or fax based on the user input.Iam fine with sending this pdf as an attachment to the user's email.Problem arises is when iam trying to send a fax.I am using the input text value as the Receipent Fax Number(Right now iam concentrating by giving a valid fax number).Iam using the below code for faxing the document and receive the below error.
String number=txtFax.Text.ToString().Trim();
FaxServer server=new FaxServerClass();
FaxDoc doc=null;
[code]...
View 1 Replies
Jul 16, 2010
[Code]....
returns the error: The parameter 'username' must not be empty.Parameter name: usernameI want to check if a user is logged. If not logged in redirect to loginerror.aspx.
View 9 Replies
Mar 26, 2011
I have a private static field in my Controller class in an MVC web application.
I have a static method in that controller that assigns some value to that static field, I want to apply lock on that static field until some other instance method in the controller uses the value stored in the static field and then releases it.
DETAILS:
I have a controller named BaseController having a static ClientId field as follows and two methods as follows:-
public static string ClientId = "";
static void OnClientConnected(string clientId, ref Dictionary<string, object> list)
{
list.Add("a", "b");
// I want the ClientId to be locked here, so that it can not be accessed by other requests coming to the server and wait for ClientId to be released:-
BaseController.clientId = clientId;
}
public ActionResult Handler()
{
if (something)
{
// use the static ClientId here
}
// Release the ClientId here, so it can now be used by other web requests coming to the server.
return View();
}
View 1 Replies
Feb 9, 2011
I m having a webService.
In that I m using Caching.
I have wrote following code to store datatable in cache.
using System.Web.Caching;
Cache.Insert("dt", dt, null, DateTime.Now.AddHours(1), TimeSpan.Zero, System.Web.Caching.CacheItemPriority.Default, null);
It give me error like "An object Reference is required for non static field.
View 2 Replies
Oct 22, 2010
Hoping someone can point me to a solution, haven't been able to find one yet.
I'm using the standard way for send HttpWebRequest
[Code]....
As you can see from Fiddler/SOAPUI it does return the SOAP fault, however using HttpWebRequest i can't capture the response.
Returning 500 triggers my exception handling and Capturing the WebException doesn't expose the response.
Does anyone know how to capture this response xml in the case of 500 Internal Server Errors.
View 1 Replies
Jun 30, 2010
I did some research after posting. All I found was simple examples for no-layer architectures, like connecting to a database from your aspx page, so, in a corporate environment, it is unnaceptable.
I need to call a server-side method (using ASP.NET Ajax) in a 3-layer architecture.
For example, my Default.aspx contains a method LoadProducts().
[Code]....
[Code]....
This cannot change. There is no way to convert Business and Data layers to static.
How can I call the LoadProducts() method using ASP.NET Ajax?
View 2 Replies
Mar 24, 2010
I am getting a CS0120 error when trying turn a button visible after checking some variables. In plain english, If AmmohelpSession.UserActions contains AmmohelpEnums.UserAction.ArticleEdit then turn the Edit button visible. Here is my comparison:
[Code]....
In the code behind for AmmohelpSession, a public class AmmohelpSession which contains a private variable: private HashSet<UserAction> _userActions; has been stated. In that same file, there is a public function for the UserActions that does a get or set method.In the code behind for AmmohelpEnums, we are setting byte variables to specific actions. Mine would be something like:
[Code]....
Where is my error coming from ?????
View 1 Replies
Oct 1, 2010
I just created a small site with form authentication with route handling. Without forms authentication, the pages route just fine. With forms, it returns back to the login page as it is not one of my allowed locations specified in my web.config file.
I know I probably need to write a custom route handler. Does anyone have an example I can follow for this?
View 1 Replies
Sep 8, 2010
When I run my website on local server asp.net routing works very well, but when I deploy it on a remote server ( asp 4.0 integrated pipeline ) it always returns with 404 error.
My url route is very simple, a stored procedure gets image's id and then displays it.
Global.asax:
[Code]....
Default.cs:
[Code]....
View 6 Replies