ASP.NET Application setting debug="false" in web.config breaks Javascript - asp.net

We have an application that works fine when we have debug="true" in Web.config, when we set this to "false" however the application stops working. It seems as if object inheritance is not working in the javascript (Microsoft JScript runtime error: Object doesn't support this property or method). Has anyone come across this before?
A bit more error detail:
a.beginUpdate() is not a function

First off, don't try to debug your javascript in IE 7 or 8. It's a losing proposition -- you'll only end up scratching your head and swearing about what that error means. Download a copy of Google Chrome, Firefox with FireBug, or IE9+. That will show you where the error really is. Start there.
Second, I'd bet it has something to do with UI objects being named differently when sent back to the client, or maybe an element just isn't there for some reason.

Well, this is what it was...a couple of the controls had the below missing in their constructors. Nice
ControlName.initializeBase(this)

I Had the same issue, after checking all the properties, I noticed the AppPool didn't have the permissions to read some files in the deploy folder, so I've created a new Application Pool Connected by a User, granted privileges and it worked.

Not come across this problem, but if you enable script debugging in IE, you can step through your javascript and narrow the problem down. I'd be surprised if javascript in the client was being affected by the app settings on the server, but I could be wrong...

Related

API setup missing something?

I am setting up a web api for the first time and I have another project for reference. It is a .NET framework project that will have a React frontend. I am running it using Visual Studio and IIS Express.
I have no build errors when I start the api project. It has swagger added so I can test database calls, so I know the api itself is working. But I am missing adding something as I am looking to add more security to it.
I am trying to verify authentication and I want to use integrated Windows authentication. When I set a break point, the user in the HttpContext.Current is never set and is never authenticated, so I can't add any authorization filters.
I went back to just the basic empty api project that has the frontend web pages removed to see if I removed something and it shows the same issue. So I either removed it again or I am actually missing adding something.
I am not sure where to look for what is missing, so any pointers would be appreciated.
The left browser is what I am expecting and the right browser is what I am seeing.
I don't need the directory browse turned on, so seeing a 403.14 - Forbidden is fine. But I am clearly missing something to get to that point. Is there a better way to figure out which resource/dependency is causing this error?
I can also see the working version requested url is what I am expecting, but the other is just a /.
Is there a way to resolve that if this is the error?
I can add code snippets if needed, but I haven't yet as I am not sure where the issue is.
I ended up finding the answer using blank test web apis to see what I may have left in that wasn't needed. The project was set up using this option:
After removing the views, etc., to make it strictly an api project. I started removing references (and clearing the associated errors) and seeing what happened with the build after each change.
Under the App_Start folder, there were some additional files that weren't present in the project I had for comparison - FilterConfig, and RouteConfig - which were also called in the Global.asax.
I removed the call in Global.asax for all three and I was able to see the expected http error page.
I dont have enough reputation for a comment, but you got 404 error, which, as you know, means there is nothing on that url. So check the route config and startup.cs Edit: I am on the phone so I didnt saw you already solved it. Good :)

Styles not applying to ASP.NET MVC site

I have a site that looks fine when I run it in VisualStudio. However, I deployed the site to my production server and for some reason, the styles are not being applied. There doesn't appear to be any errors, missing resources, or permissions issues on the live server. I have been able to simulate the issue while running it in VisualStudio by commenting out the #Styles.Render("~/Content/css") line of code in my view. I'm not suggesting there is a problem with the line of code. I'm just saying if I remove the line of code, the styles aren't applied while debugging just like on the live server. The IP address to a very trimmed down version of the issue is http://69.2.50.212 if seeing the error will help. I wish I could provide more info but I really don't know what else to include.
This might be due to this problem.
Images not loading through CSS on IIS7.5 MVC4
I found similar kind of error while inspecting your page.

Default page links not working in IE 10 on one server but working fine on other with same configuration

i have deployed my application from IIS 6.0 to IIS 7.5. the website links does not work in IE 10 from Prod but from uat the website is accessible. both the server are same.
Does anyone know why this is happening in only one server and not the other. Do i need to change some setting in IIS or config file. I am getting the error of
SCRIPT5007: The value of the property '__doPostBack' is null or undefined, not a Function object
Can anyone please help i am facing this issue on production.
"There is a bug in the browser definition files that shipped with .NET 2.0 and .NET 4, namely that they contain definitions for a certain range of browser versions. But the versions for some browsers (like IE 10) aren't within those ranges any more. Therefore, ASP.NET sees them as unknown browsers and defaults to a down-level definition, which has certain inconveniences, like that it does not support features like JavaScript."
http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx
Maybe that could be it?
Thought I'd share for posterity since every page on the internet links to the browser files issue.
This can also be caused in some cases by a change in the .Net Framework 4+ where encoding the __doPostBack encodes a single quote (it did not do this in 3.5).
I was able to fix a LinkButton with that error by manually putting the __doPostBack into the OnClientClick, overriding the href and not encoding a single quote. Granted, maybe not clean, but it worked for me.
http://www.blakepell.com/asp-net-4-5-1-linkbutton-the-value-of-the-property-__dopostback-is-null-or-undefined-not-a-function-object

Unable to start debugging IIS 7.5 Detailed Error - 500.19

I tried to run my WebApp on my local machine today (nothing has changed on it) and I had the above error. I know my machine had a windows update recently (not sure if that has anything to do with it).
The error produces a big print out of css styles and html markup.
In the markup it also says "The requested page cannot be accecssed because the related configuration data for the page is invalid".
Maybe you accidentally changed the web.config and now contains a malformed section. I'd recommend you take a close look to your configuration file.
I'd say that the error page should tell you the necessary information to solve the problem but I assume that if you're asking if because it's not the case :)
I changed the user info. (windows password which was changed) in the IIS & that helped me :)
You may need to enable windows (or some other type of) authentication in IIS for the site specifically.

Using HttpModule to Display Images

I have an HttpModule that displays images that follow a certain URL pattern. For example, /images/employees/jason.jpg is handled by the module, but all other images aren't. It works just fine on my local machine (Cassini and IIS 7). However, the IIS6 production server isn't working. I've had the hosting company map the images to the ASP.NET worker process. Now, all images are showing that they can't render except for the images that should be rendered by the module. They are working correct.
I ran an HttpWatch instance on one of the files and received the following error:
ERROR_HTTP_INVALID_SERVER_RESPONSE
Any ideas?
Final Answer:
The module needed to be updated to transmit server files. So, I added an else to my original if and checked to see if it was an image type (by using a utility method) then use Response.TransmitFile() to pass on the file to the browser.
I then ran into a spacing issue with the images. This was because I forgot that I had .aspx files registered as an image type to perform the testing. So each page would crash during the debug process or add padding that was established from CSS. Doh!
Everything is just peachy now. Thanks to all!
There's doesn't seem to be anything particularly wrong with your module, so the issue must be coming from somewhere else. Have you got security that might be blocking the images? What actually gets returned when you request a static file?
I'd suggest seeing what gets returned (and its headers) using something like firebug to check things like the response code, content type, the actual raw response, etc...
check your web.config IIS6 / IIS7 have different places to add modules and depends on what mode your IIS7 is running in.
http://arcware.net/use-a-single-web-config-for-iis6-and-iis7

Resources