httphandler

http handlers not working on web server but works on localhost

i have a couple of xml files in my asp.net web application that i don't want anyone to access other than my server side code. this is what i tried.. <add verb="*" path="*.xml" type="System.Web.HttpForbiddenHandler" /> i wrote this inside the <httpHandlers> it works well on the localhost but not in the server... the server without any...

How to save data between calls to a IHttpHandler?

I have a IHttpHandler that acts as a source to a jQuery Autocomplete input field. In the constructor of the handler I generate an index that remains fairly static between request (needs to be rebuilt maybe once a day). How can I cache the the index between calls? Debugging indicates that the constructor is called for each request. I've ...

Form Authentication woes, calling http handler on app2 from app1 not authenticating

I have 2 asp.net web applications. http://app1.local/ and http://app2.local/ App2 has a httpHandler that takes in some credentials, and logs the user in using forms authentication. FormsAuthentication.SetAuthCookie(cookieUserName, createPersistentCookie); HttpCookie authCookie = context.Response.Cookies[FormsAuthentication.FormsC...

Custom HTTPHandler causing caching or session issues?

So i have a custom CMS running under .Net 3.5 written entirely in c#. The engine is optimized to render for mobile devices, but also server to normal web browsers. It also supports cookieless sessions. Great... I've chosen not to cache anything (including browser data) in order to control the rendering completely from data. This has bee...

How do I rewrite a file name into the browser using a httphandler - is it possible?

I have a httphandler that is fitred for all .png files. I would to be able to rewite the name of the file into the html. Is this possible? So if test.png comes into the handler I want to write test.png?V=1 So far I have found the following: context.Response.AddHeader("content-disposition", "inline; filename=" + context.Request.FilePath...

ASP.NET - Dynamically register an HttpHandler in code (not in web.config)

Is there a way I can dynamically register an IHttpHandler in C# code, instead of having to manually add it to the system.web/httpHandlers section in the web.config. This may sound crazy, but I have good reason for doing this. I'm building a WidgetLibrary that a website owner can use just by dropping a .dll file into their bin directory,...

How do I exclude things that match the specified path for an HttpHandler in ASP.Net?

I know that if I want to have requests for MyPage.aspx go to the class called MyHandler in the assembly called MyAssembly, I can add this to my web.config file: <configuration> <system.web> <httpHandlers> <add verb="*" path="MyPage.aspx" type="MyHandler, MyAssembly"/> </system.web> </configuration> This works for any MyP...

iis7 compress dynamic content from custom handler

I am having trouble getting dynamic content coming from a custom handler to be compressed by IIS 7. Our handler spits out json data (Content-Type: application/json; charset=utf-8) and responds to url that looks like: domain.com/example.mal/OperationName?Param1=Val1&Param2=Val2 In IIS 6, all we had to do was put the edit the MetaBase.x...

[ASP.NET] Odd HttpRequest behaviour

I have a web service which runs with a HttpHandler class. In this class, I inspect the request stream for form / query string parameters. In some circumstances, it seemed as though these parameters weren't getting through. After a bit of digging around, I came across some behaviour I don't quite understand. See below: // The request co...

Need Help with .NET OpenId HttpHandler

I'm trying to use a single HTTPHandler to authenticate a user's open id and receive a claimresponse. The initial authentication works, but the claimresponse does not. The error I receive is "This webpage has a redirect loop." What am I doing wrong? public class OpenIdLogin : IHttpHandler { private HttpContext _context = null; p...

CDN for Images in ASP.NET

I am in the process of moving all of the images in my web application over to a CDN but I want to easily be able to switch the CDN on or off without having to hard code the path to the images. My first thought was to add an HttpHandler for image extensions that depending whether a variable in the web.config (something like ) will serve ...

How to modify markup in ASP.NET without using Response Filter

Since ASP.NET response filtering and post-cache substitution are not compatible, I need an alternative way of filtering output. Reference: http://support.microsoft.com/kb/2014472 Is there any way to change the markup without using response filter? ...

How to serve a View as CSV in ASP.NET Web Forms

I have a MS SQL view that I want to make available as a CSV download in my ASPNET Web Forms app. I am using Entity Framework for other views and tables in the project. What's the best way to enable this download? I could add a LinkButton whose click handler iterates over the view, writes its CSV form to the disk, and then serves that fi...

Sitemaps on multiple front end servers using a http handler, is that a good idea?

Question 1 We would like to generate a site map for our CMS site We have multiple front end servers with approx a million articles. Environment multiple MS SQL servers multiple front end servers (load balanced) ASP.net - and IIS 6 Windows 2003 To have the site maps (the site map index file, and the site map files) physically on t...

Images from SQL Server JPG/PNG Image Column not being Type Converted to Bitmap in HttpHandlers (consumed by Silverlight Client)

Our Silverlight 3.0 Client consumes Images stored/retrieved on the File System thorough ASP.NET HttpHandlers successfully. We are trying to store and read back Images using a SQL Server 2008 Database. Please find the stripped down code pasted below with the Exception. "Bitmap is not Valid" //Store document to the database private...

Httphandler Version Aspx Code Behind writing Image file

We have encountered this difference in file creation while using a HttpHandler Versus a Code Behind Aspx page. We are reading a saved jpg/png picture as byte array from a 'Image' field in sql server database and create a physical file in the server. Both the Aspx Page and Httphandler use the same code pasted below. //Begin int docID ...

How can I stop IIS7 from using HttpHandlers?

I'm having a bit of a play around with IIS7, just trying to catch events manually in global.asax and skip the ASP httphandler pipeline entirely. To this end, I've set <httpHandlers> <clear/> </httpHandlers> <httpModules> <clear/> </httpModules> but when I call the server I get a YSOD [HttpException]: No http handler was fo...

HttpHandler that tracks when an image is loaded in an email

I want to track whenever an email is viewed, so I figured creating a httphandler that reacts to an image, say whenever acme.gif is viewed. is this straight forward? Is it just a matter of putting the correct config setting like: <add verb="*" path="/images/track/acme.gif" ... /> Is this correct? ...

When your vs.net project is type website, what's the namespace/dll you reference in your handler web.config?

When your vs.net project is type website, what's the namespace/dll you reference in your handler web.config setting? you normally have to do: "YourNameSpace.Class, Class" ...

Asp.net Google Charts SSL handler for GeoMap

Hi All, I am trying to view Google charts in a site using SSL. Google Charts do not support SSL so if we use the standard charts, we get warning messages. My plan is to create a ASHX handler that is co9ntained in the secure site that will retrieve the content from Google and serve this to the page the user is viewing. Using VS 2008 S...