ihttphandler

Why my HttpHandler is ignored?

Hi, In an ASP.NET application, I need to do some changes on every CSS file sent. So I created an HttpHandler (inside the app itself), added: <add verb="*" path="*.css" type="MyWebsite.CssTestHandler,MyWebsite"/> to Web.config in system.web/httpHandlers and modified the handler like this: public void ProcessRequest(HttpContext conte...

Ihttpmodule ,Ihttphandler .NET

I have some doubt over HttpModule and HttpHandler Please help me to clarify 1)In HttpModule I have noticed methods Init called only once . context_BeginRequest and context_EndRequest etc method calling for each request. Is it guaranteed that for a module Init will call once for different users(or different request) and BeginRequest etc...

Access to GetRouteUrl in IHttpHandler implemented class

I have and httphandler "rss.ashx" that exposes an rss feed. I want to use GetRouteUrl inside this handler. How do I do it? ...

ASP.Net: Create handler within project

Hi, Sorry if this is a stupid question. I want to create an HTTP handler within my project. To do this, I created a new class, and tried to implement IHttpHandler. Each time I do this, I get the error 'End of statement expected'. I know that normally you can create a new class library and create a class to implement a handler. But w...

Can ASP.NET Routing be used to create "clean" URLs for .ashx (IHttpHander) handlers?

I have some REST services using plain old IHttpHandlers. I'd like to generate cleaner URLs, so that I don't have the .ashx in the path. Is there a way to use ASP.NET routing to create routes that map to ashx handlers? I've seen these types of routes previously: // Route to an aspx page RouteTable.Routes.MapPageRoute("route-name", ...

Can you programatically define ASP.NET configuration?

Is it possible to define a large portion, if not the entire, web.config of an ASP.NET application in code? If so, how? Would you use an IHttpModule? In the same vein, can you resolve an IHttpHandler within said module to handle all incoming requests? Edit 1: The last bit was instigated by this answer to another question. Edit 2: What I...

using HttpHandlerFactory to render CMS and physical pages

Hi, I am in the middle of writing a CMS system and after reading and working through a few examples, I have settled on HttpHandlerFactory to perform what I need. the key point is our sites are generally a mix of copy and registration processes. So I currently need to use the default HttpHandler for aspx to render the physical registrat...

Configure IHttpHandler in the Test Web Server

I am trying to implement an IHttpHandler. I have defined an appropriate class but the debug web server (you know, the one you get if you hit f5 in Visual Studio) is responding with "Can't Display Page". I looked here http://msdn.microsoft.com/en-us/library/ms228090%28v=VS.90%29.aspx to learn how to configure the handler, and it seems th...

Accessing DataTable.Rows performace decreases over time?

I have a IHttpHandler that I'm using to import an uploaded CSVfile into a database. The class has a static DataTable variable. They first time the handler is run, it opens the CSV file, reads it in to the static DataTable class and closes the file. Each time the handler is accessed after that point it starts a a for loop with the reques...

downloading multiple files using Ihttphandler

Greatings! I'm working on a reporting script which runs a number of reports (pdf) on button click. The reports are created on the web server then I'd like the user to be given the option to download the files. I have worked out the script for downloading one file from the server. But I'm not sure how to download multiple files? (there ...

IE bug? Using a IHttpHandler to retrieve images from database, getting random blank images

Hi, I'm using ASP.net/C# and trying to build an image gallery. My images are stored as byte data in the database and im using an axd file like so, getDocument.axd?attachmentID= X, to set an Image object which is then added to the aspx page on page load. In IE most of the images are rendered to the page however certain images arn't rend...

Update page after file download

Hello! I put together a download script after some wonderful help from stack overflow the other day. However I've now found that after the file has been downloaded I need to reload the page to get rid of the progress template on the aspx page. The code to remove the template worked before I added in the download code. Code to remove ...

Testing a method that implements IHttpHandler.ProcessRequest

So I have a method that implements IHttpHandler.ProcessRequest. It accepts an HttpContext parameter. This parameter is just a form that is filled out with some XML. Here is the HTML that I am using to generate the post context: <html> <body> <form name="form1" method="post" action="http://localhost:7703/api.ashx"&gt; <textarea name="XML...