httphandler

Problem with HttpHandler and session state

I'm trying to fashion a solution which will simulate App_Offline.htm for remote access but still allow local users to test the website out. I found some various options that I am trying out but the best one doesn't seem to work for our ASP.NET(2.0) site which relies on session state being enabled on all of the pages. The HttpHandler is...

ASP.NET 4 HttpHandler in Custom Route

I have made a custom Route which override GetRouteData. How can I know what type of request is being done? Everything passes the GetRoutData function (.css, .js, .axd, etc) and I would like to do something only if it is a System.Web.UI.Page. But httpContext.Request.CurrentHandler is always null because the routing takes place just befor...

Asp.net creating tab delimited txt file

I have to create a tab delimited txt file from a query. I want to call an HttpHandler that returns my txt file as a stream, I don't want to create the file phisically. 1st question: what is the best practice to create the tab delimited txt file from a query result? I have to fetch all rows and create the file manually? 2nd question: H...

Website is ignoring System.Web.HttpForbiddenHandler and allowing download of web.config

My website is allowing the web.config file to be downloaded. However in my C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config file I have this line <add path="*.config" verb="*" type="System.Web.HttpForbiddenHandler" validate="true"/> Which should mean any config file can't be downloaded. What am I missing? ...

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...

Asp.Net HttpHandler and jQuery Ajax call

These are 2 questions. The first one: I have an HttpHandler returning a zip file to download. I have this line of code: context.Response.AppendHeader("content-disposition", "attachment; filename=myzipfile.zip"); The question is: should I declare the ContentType (application/zip) also ? The second question is: I want to call this Http...

jQuery ajax call to httphandler returning zip file

I have an httphandler that creates a zip file and returns it for download. context.Response.AppendHeader("content-disposition", "attachment; filename=myfile.zip"); Is it possible to call the handler from a jquery ajax call? If yes, what kind of dataType should I declare? Thanks ...

How to tell who called an HttpHandler

How can I tell from within an ASP.NET HttpHandler if it is executing because of a call to Server.Execute("myHandler.ashx") or because of the user linking directly to myHandler.ashx? (Besides using a querystring parameter). ...

Is there any way to get acces and change to Page before leave the server?

Hi, I want to change page content while it is going from the server because i need to add some advertisements inside the html elements that are advertisement holder. protected void Application_PreSendRequestContent(object sender, EventArgs e) this is good but i couldn't get access to HttpContext . Should i, i don't know :) But in thi...

Using an HTTP handler in ASP.NET to generate an image for display in email

I'm generating a barcode image as the response from an HTTP handler, like so: public void ProcessRequest(HttpContext context) { context.Response.Clear(); context.Response.ContentType = "image/Jpeg"; MemoryStream ms = new MemoryStream(); Bitmap objBitmap = GenerateBarcode(context.Request.Params["Code"]); objBitmap.Sa...

How to disable gzip for just one handler .ashx

I am running a website using IIS6 and i wrote a simple generic handler which return smaller images when it receive image url as query string. My problem is that the server is applying gzip to some file types such as .aspx and .ashx. And that made my response image from the handler appear with lower quality because they are compressed. ...

Resize image on the fly make the image lose quality online but locally works nice

Possible Duplicate: Resize image on the fly make the image lose quality online but locally works nice I wrote this handler to resize images on the fly: Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest 'Read in the image filename to create a thumbnail of Dim image...

Setting HTTPHandler isreusable property.

Hi all, I am using a HTTP handler to raise a file download.Basically code in the 'ProcessRequest' retrieves data from the database,creates a temporary copy of the existing template spreadsheet with a GUID as its name and writes data retrieved from the DB into it cell by cell using COM,raises a file download and deletes the temporary spr...

What controls the image quality in IIS based on the following example?

I had this question before "Resize image on the fly make the image lose quality online but locally works nice" And what i got now is that it's not a problem of local or online, i ran this resize on the server itself "dedicated server", and i got the same bad quality image, so the problem is in the IIS configurations. What in iis can ma...

IIS dynamic compression and HttpHandlers

Does anyone know if it's possible to use IIS Dynamic Content Compression to compress the output of an HttpHandler (.ashx) ? ...

Using HTTPHandler in C# .NET 3.5 with jQuery Week Calendar

I've been trying to get this to work for weeks now, all to no avail. I am sure that my code must be failing through something fairly small and stupid, but having tried a number of different approaches I'm starting to really struggle as to what the problem might be. Has anybody else managed to get the jQuery Week Calendar (http://github.c...

Asp.Net Routing to a generic handler

I Have a generic handler that's serving member logo images: http://site.com/logo.ashx?memberid=123 Now, I want to use it by caling a url like: http://site.com/logo/john.jpg So I would create a route for that (pattern: "logo/{username}.jpg"). But, my problem is - how do I retrieve {username} when inside ProcessRequest() of my generic...

HttpHandler to download txt files (ASP.NET)?

Hey, I created a HttpHandler for downloading files from the server. It seems it is not handling anything...I put a breakpoint in the ProcessRequest, it never goes there. public class DownloadHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { //download stuff and break point } } It never stops t...

Using Dependency Injection with Http Handlers

I am using ASP.NET MVC 2 with Ninject, and Linq2SQL behind a repository pattern, based on Rob Conery's TekPub Starter Site. With controllers it all works fine, however I have an HTTP Handler (it serves and resizes images from a DB), and I have no idea how I use Ninject to replace my ISession interface with a concrete instance of my Linq...

SWFUpload+IHttpHandler is waiting to buffer entire file

I am currently having a problem using SWFUpload to upload a file and using an HttpHandler to handle the upload. As soon as the Context.Request.File["Filedata"] object is accessed it waits for the entire file to buffer. This prevents me from quickly validating based on things like the filename. Also I'm mainly concerned because the beh...