httphandler

IIS pipeline: what goes first: URL Rewrite or HttpHandler?

What happens first in the pipeline: a URL Rewrite (as defined in the URL Rewrite module of IIS), or a HttpHandler (added with the add managed handler functionality of IIS7)? ...

Http-handler load error

I successfully added and configured HttpHandler in an Asp.Net WebApplication, but facing problems while trying to add same HttpHandler to Asp.Net WebSite. I have registered it in the web.config, am i missing something This is the error I am getting Configuration Error Description: An error occurred during the processing of a conf...

Pattern for Reusable asynchronous HttpHandler

I'm currently developing a custom HttpHandler (for compressing/combining CSS, but that doesn't matter for this question). I started with a simple reusable=true synchronous HttpHandler like we all know. Now i'm trying to improve it to an asynchronous handler (as it uses IO functionality and it's used on a very busy website). My first a...

How do you handle RESTful-type URLs with an IHttpHandler

This question has two related parts. First, I'm looking for a a small example of how to handle a series of RESTful URLs, such as /Account/{userName} and /Account/{userName}/Profile with a single HttpHandler. At this time, I'm not interested in embracing MVC or using the REST Starter Kit. Should I place the HttpHandler class in a Class Li...

Setting the Referer using HttpWorkerRequest's SendKnownResponseHeader method

Hello, I'm developing an IHttpHandler in an ASP.NET MVC project and I want it to be as fast as possible. I've read that using HttpWorkerRequest was much more efficient than getting/setting data directly from the HttpContext object because it bypasses all the checks/conversions/encapsulations done by the framework. It works pretty well...

Probem with links Embedding the app engine's shell app within my own app, for help coding

In my own App Engine App, at the browser, I wanted to mess around with new code by simulating having access to the python interpretor's >> within a browser window by embdedding this app --> http://shell.appspot.com/ . One can get shell_20091112.tar.gz at http://code.google.com/p/google-app-engine-samples/downloads/detail?name=shell_200...

Render HtmlGenericControl from a HttpHandler

Hi, I have a set of code (noted below) in ProcessRequest(HttpContext context) in a generic handler .ashx file. HtmlGenericControl holder = new HtmlGenericControl("div"); //Set holder's properties and customization HtmlGenericControl button1 = new HtmlGenericControl("input"); //Set button1's properties and customization holder.Controls....

HttpHandler fire only if file doesn't exist

Hey, I'm trying to create a HTTP handler to handle all requests to a folder but I only want it to fire if the files requested don't exist (EG: Request comes in for file X, if X exists I'd like to serve the file, otherwise the handler should deal with it). The files will only be static content, not scripts themselves, which I assume mak...

How do I prevent unauthorized attempts to access a specific file type?

This is really a couple of questions about preventing unauthorized attempts to access a specific file type. Here go the questions: How do I prevent users from directly requesting a type of file? Do I write an HTTP handler? After preventing a direct download, can my app still explicitly serve that file type? How? ...

How to embed an ASP.NET Web Application into another?

Providing web features through a custom HttpHandler such as in Elmah is extremely handy for ASP.NET Web Applications, because the handler can be embedded into any ASP.NET web app. It perfectly fits as a simple way to extend an existing web app. Now, developing any significant set of features through a custom handler is a very tedious pr...

Need to call client script before a Response.Redirect. Any suggestions?

I have a page that when the user clicks a button there is a custom loading panel placed in the update panel by the PageRequestManager BeginRequest event. So when the page is loaded the loading panel is removed. My issue is that when the user clicks a button that redirects to an httphandler the page is not reloaded therefore the loading p...

Getting Session in Http Handler ashx

Hi All, I am using Http Handler ashx file for showing the images. I was using Session object to get image and return in the response Now problem is i need to use custom Session object its nothing but the Wrapper on HttpSession State But when i am trying to get existing custom session object its creating new ... its not showing sess...

Validate element in http handlers

In ASP.NET, http handlers can contain a validate element. What exactly does this do/mean? ...

How do I remove ajaxpro *.ashx handlers from individual pages?

I working on a ASP.NET web project where Ajaxpro.2 is referenced, and it seems automatically to add a bunch of ashx handlers to the page output - ie, core.ashx, prototype.ashx. The problem is, I only need these to be present on a few pages, not the entire site. In trying to optimize the page download size (particularly for static public...

httphandler doesn't engage for non-home pages

I have an MVC2 application, and HttpHandler Library. The library, to simplify, serves an image. The problem is that if I invoke this handler from the root page ( http://whatever/ ), everything works fine. If, however, I change the Global.asax, so the same page now has the address of http://whatever/controller/action - it doesn't work (AL...

Javascript Script Combining and Caching

I am building a AJAX intensive web application (using ASP.NET, JQuery, and WCF web services) and am looking into building an HTTP Handler that handles script combining and compression for my JavaScript files and my CSS files. I know not combining the scripts is generally a less preferred approach, and I'm sure it's probably the way I wil...

Caching the response of an ASP.NET HTTP Handler server and client side

Is it possible to cache the response of a http handler on the server and on the client? This doesn't seem to be doing the trick: _context.Response.Cache.SetCacheability(HttpCacheability.Public); _context.Response.Cache.SetExpires(DateTime.Now.AddDays(7)); The _context is the HTTPContext passed as an argument to the ProcessRequest met...

HttpModule to Write Out JavaScript Script References to the Response

On my page in the Page_Load event I add a collection of strings to the Context object. I have an HttpModule that will fire EndRequest and retrieve the collection of strings. What I then do is write out a script reference tag (based on the collection of strings) to the response. The problem is that the page reads the script reference but ...

Server side caching doesn't work with HttpHandler

If we use an aspx page with a Caching Profile, the server caches images that are loaded with the aspx page. So if ten clients load the same image through the aspx page (same url), for one client the image is gotten out of the db, for the nine others it is cached. When we use a HttpHandler, this doesn't happen. The image is always fetche...

Caching the xml response from a HttpHandler

My HttpHandler looks like: public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/xml"; XmlWriter writer = new XmlTextWriter(context.Response.OutputStream, Encoding.UTF8); writer.WriteStartDocument(); writer.WriteStartElement("ProductFeed"); DataTable dt = GetStuff(); for(...)...