I am generating a System.Drawing.Bitmap on the fly in an ASP.NET Custom Web Server Control, and then I want to serve this bitmap as part of the WebResource, because I do not want to save it on the hosting computer. Is there a way to instruct ASP.NET to serve the generated System.Drawing.Bitmap as part of it's WebResource? (therefore making it an "Embedded Resource")
As we're using urlrewiting in a Netscaler to forward all requests for the "/social" folder onto a seperate server farm containing this app, the "/" root path won't resolve correctly as it will be requesting the resource from the something.com app.
Therefore I need to change the url of the requested script to either request it explicitly:
My website is looking in the wrong place for the scriptresource.axd and webresource.axd. How do I point it at the correct subfolder? Or how do I set it so that scriptresource.axd and webresource.axd are stored in the root of the website?All the ajax is done within subfolders. The web.config is at the root of the website.
We have an array of about 12 servers serving a website. Over the past few hours, one single server has started throwing exceptions for WebResource.axd and ScriptResource.axd requests.
System.Web.HttpException - This is an invalid script resource request.
at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I have checked the web.config, machine.config for every server and they're all identical. The only difference been able to find so far is that prior to the problem commencing, the servers were patched, after which, the problematic server looks to be using different version of the System.Web.dll to the others?
I have someone doing a penetration test on a site and they are trying to exploit WebResource.axd. I'm confused because whenever I try his URL I either get it trying to download to a text file in IE or displaying as text on FF
He says that it is giving him an alert with 16146 in it, I can't fix it because I can't even duplicate it.
I have customErrors defined within web.config, everything is going to the same concise error page. I kind of get how you COULD exploit this file but I just want to know what I managed to do that causes it to come across text.
In our test environment, with the same code, everything works fine. This tells me there was something on the production server that's preventing this from working. About 4 days before this started happening, we found that some user documentation (PDF) wasn't being protected by Forms Authentication (we need only legitmate users having access to it) so we added a wildcard mapping in IIS with "verify that file exists" was unchecked, knowing that if it were checked, we'd have this problem. I had one of the network admins check this setting after this started happenig and he said that it was still unchecked. I asked him to remove the wildcard mapping altogether and I still see the same behavior.
I am certain that this isn't a coding problem; again, as it went through the QA process in our test environment, everything works perfectly. And after the last deployment to production three weeks ago, everything was perfect as well. We added the wildcard mapping (which shouldn't have had an effect) and four days later the site breaks. I've asked our IT department if any changes were made to the server recently and nobody says they did.
What settings does anyone know of that might be causing this, either server or application? I checked the web.config and all the sections are there that deal with the ScriptResource HttpHandler and HttpModules. In fact, the web.configs are identical between the production and test environment, so I know it hasn't been tampered with.
I have published a website and installed it on my local machine and it works fine, but when i install it on the both servers who controlled from the load balancer i got an error like the WebResource.axd not found. how can i resolve this problem? i have checked the IIS for axd mapping, the "Check that file exists" is unchecked for both servers.
I have introduced site wide exception handling on my site to catch unexpected errors. The event handler sends a message to me when such an exception occurs. But the problem is that any clicks on my site will cause an exception to be thrown with the message: "This is an invalid webresource request."
I googled for an answer and only found a couple of references to 1. setting a fixed machinekey (which for some reason didn't work for me, I got an error saying that the virtual directory wasn't set in IIS, and as far as I know I'm not using IIS at all, I'm using the local development environment and then deploy to a web host) or 2. using a robots.txt file to stop robots from accessing the axd files, but that doesn't help either because it's not robots that cause the problem, anyone clicking around on the page will cause this error. how to solve this problem properly? For now I have handled it by catching and ignoring this particular error by the text in the error message, which works but I would rather fix it so that this error doesn't occur at all.
I migrated an ASP.NET 3.0 application from one web server to another. The only difference that I know of between these webservers are, one is running II6 and the new one (the one this app was moved to) is running IIS7. The application was running fine in it's old environment, no code changes were made, but now it doesn't seem to like the web.config. I get the following error:
There is a lot of discussion about todays fix for ASP.NET to prevent an attack that can be used to get the encryption keys from an application. In one discussion I read that it could also be used to make the WebResource.axd handler return any file in the application by forging the request parameters to point to a known file location (where /web.config would be the most obvious choice).
To clarify, I understand that when a user hits the public-facing URL, it resolves to x.x.x.1. x.x.x.1 is the address for a switch which routes the request to either x.x.x.2, x.x.x.3, or x.x.x.4. When I use the public-facing URL, I find that some of the axd file requests are intermittently rerouted to Error.aspx! WTF? I'm told that this is the result of a security feature that is meant to protect me from cross-site scripting and other assorted bad stuff. What can I do? Update After taking out some error page auto-redirects, I get a more meaningful error message: ASP.NET Ajax client-side framework failed to load.
We have an issue when our web application runs under reverse proxy.
The reverse proxy change the URL for the website from for example: "http://TestWebApp/" to: "http://ProxyDomain/Test/" when it runs under reverse proxy which is mapped to "http://TestWebApp/" and rout requests to it.
This raise an issue of root relative paths (paths that start with "/" to be relative to the root of the web application i.e. "/Folder1/Test.aspx"). Generally all paths that need to be rendered to client we use ResolveClientUrl method and all is good.
When using Ajax controls and ScriptManager WebResource.axd paths are rendered in script tags as a relative url paths ("/WebResource.axd?blablabla") because the root under reverse proxy is the proxy domain itself the path is useless - the web resouce is not downloaded and the application break.
To fix this we tried to set a Response.Filter in OnPreRender event handler of our base page. In our custom filter we use Regex to search and replace all "/WebResource.axd" occurences with the resolved to client root path using the ResolveClientUrl method of the page. This works great and the web resources are downloaded to client.
But this is not the end of our troubles.
In Ajax requests the response output is fixed as described but when recieved at the client end it is not valid and the partial update fails with Sys.WebForms.PageRequestManagerParserErrorException.
It fails to parse the response because the rendered response have numbers that states the actual count of bytes per rendered component (which includes the script tags referencing the WebResource.axd). The client reciever validates the recieved response according to the numbers, but, our filter altered the response so the numbers are not correct and the response validation fails.
We can try and code a smart filter that parse the response and recalculate the numbers according to the ammount of paths fixed, but I hope there is an elegant and better solution for this.
In my web application, I have used AJAX Toolkit and my .net version is 3.5. When I run the application and save the page, so many ScriptResource.axd and WebResource.axd generate which makes the file size 200 to 300 KB more big. After doing the same procedures mentioned in the above link, it was working fine as all ScriptResource.axd and WebResource.axd file is removed.
But when I go from one page to another page using on click, then Object Expected Error comes and when I debug it,I found one ScriptResource.axd file containing query string like .axd?d=-bA.like this and Request. GetResponse cannot find the file and it gives 404 errror (File Not Found).