ihttphandler

Stream (and convert?) multi-page TIFF using ASP.NET

I have built a simple image viewer in .NET and have the requirement to display multi-frame TIFF images in the browser. Presently, I have a (ashx) handler setup to stream back JPEGs that are co-mingled in the same database as the multi-frame TIFF's and it's worth mentioning that this handler will also return the first frame of the TIFF fi...

Using an HTTP Handler to process file downloads...all files open in notepad when using firefox

I've written a httphandler to process downloading of files. Regardless of the mime-type, all files try default to notepad when using Firefox. My Code snippet is below. //let's assume that the item object has these values. item.Filename = "testfile.pdf"; item.MimeType = "application/pdf"; context.Response.Buffer = true; context.Respon...

Why isn't my IHttpHandler being called?

I'm trying to get a custom handler to work for a specific URL (or set of URLs) in ASP.NET 3.5. The handler doesn't actually do anything significant yet - it just logs the request. I can post the code if anyone things it's relevant, but I really don't think it's being called at all. (In particular, for normal exceptions I get a custom er...

ASP.NET development server unwilling to upgrade to .NET 3.5

I had an ASP.NET 2.0 web project. Worked fine. I decided to upgrade the site to 3.5. The upgrade worked fine. I have added a IHttpHandler that required to include the following line in the web.config: <add verb="GET,POST" path="MyOperation.asmx" type="MyClass"/> This line in the web.config generates the following error: "Parser Error ...

Has anyone succesfully called this method: HttpServerUtility.Transfer(IHttpHandler, Boolean) ?

Hi there, I am doing some nifty research in my search for an optimal solution in regards to dynamic server transfers to classes implementing the IHttpHandler interface, and for this, I would like to experiment with the in title specified method signature. When I look in the MSDN documentation, I have my normal trivial implementation wh...

The system.web.ihttphandler reference?

hi. i use a Project.Web appclication and i need to use the system.web.ihttphandler but i cant find the reference, why is that and what could i do about it? i google some could not find any helpful answer. ...

Calling a handler in JS to get upload file progress

Hi, I have a form with an embeded iframe which points to a upload.aspx. During the upload that happens within the iframe, I'm trying to get the progress of the upload by implementing my own HttpHandler, however, the request is blocked until the upload completes. Is there a request limit that I can change in the web.config? Is this even...

How to find if a request is for js or css in httpHandler

Hi guys, is there any way to find if a particular request is for JS or CSS in httphandler to improve the performance of my website i was using HttpCompress from Code Project http://www.codeproject.com/KB/aspnet/httpcompression.aspx?msg=2544100 but since it is combining all the js it is breaking my javascript in many places...so i want...

How not to be limited by image size using an Image Handler

I am converting text to image. Some of the text is longer in length than others. How do I make sure that none of the text is truncated? The code below is limiting my bitmap to 250, 30. System.Drawing.Bitmap imgIn = new System.Drawing.Bitmap(250, 30); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(imgIn); g.Clear(System.D...

IHttpAsyncHandler causes UnathorizedAccessException

Hey fellow geeks, For the last couple of days of my X-mas holidays, I have been struggling with an UnathorizedAccessException when trying to READ a XML file on a remote share through my ASP.NET application using an implementation of the IHttpAsyncHandler a long with the IRequiresSessionState. After much headache, and concluding that th...

Difference between using IHttpHandler and webservice

Hi There, i need to understand when these two implementations used . what could be the motive of using one over other , can these be leveraged interchangeably. Thanks in Advance Dee ...

Firefox not handling content type correctly when using IHttpHandler

Firefox is for some reason not properly handling content sent through my .NET HTTP handler; it appears to be not honoring the content type header. Rather, it sees the content as being HTML. The URL mapped to the request even has a .csv extension. Internet Explorer and Chrome are doing the right thing. The problem is happening for bot...

Should I set IsReusable to True in my HttpHandlers?

I've never fully understood this property of the IHttpHandler. It is a property that you have to set when you implement the interface. I've assumed that setting it to true would be better for performance, but I am not sure what the negative side effects might be. Should I return true or false? ...

Conditional HttpHandler: how to make certain requests return the default response?

I'm working on an IHttpHandler implementation which will handle all *.gif files. The Handler itself will have code in it to check whether the *.gif files are requested from a certain URL. If this is the case, some customer logic should be performed to put a customer gif in the response. But I don't know what to do when a regular gif is ...

Create Instance of a UserControl in ASHX Handler Where ASCX Depends on a Parent ASPX.

Hi all I found this extremely useful article on creating instances of ASP.NET UserControls in .ASHX Handlers by Scott Guthrie. Unfortunately I now have a requirement now where I need to create an instance of a UserControl which has a dependency on the parent page. This being the case, I can't use the same method to create the UserContr...

Lightest http host for server-side C# code.

I currently have a prototype web service hooked up to a single .aspx page under IIS. Calls to the server-side logic are made through an http mywebengine.aspx POST interface with common Post parameters for all server functions. No html is shipped from the web service, instead JSON data structures pass in and out on each call. The web ser...

Add my own page extension in asp.net

Hi All, I am trying to add page with custom extension, say .asp2 with my set of html tags. Now whenever i try to access the page on browser...it asks me "Save as". This happens because I am using an extn which the server is not able to recognise. What should I do to so that my server, IIS 5.1 recognises this extension?? Please suggest ...

ASP.NET - Creation of custom page with custom tags, with event handling

Hi, I am trying out some code which enables me in creating a page with extension .asp2 The tags included will also be custom, something like: <asp2:H> <asp2:T> First Page </asp2:T> </asp2:H> <asp2:B> <asp2:D> <asp2:Label>Welcome......</asp2:Label> </asp2:D> </asp2:B> I have done the necessary changes so that ASP.NET i...

ihttphandler to write out file exactly as is

I am writing a class that inherits from IHttpHandler for script and css combining. I only want to combine if the querystring has a special parameter defined. If this parameter is not defined then I want to write the contents of the file as if the handler wasn't even involved. What is the best way to deliver the file unharmed? EIDT: The...

IHttpHandler Request object and virtual directory issue

I am writing a class that inherits from IHttpHandler for script and css combining. I only want to combine if the querystring has a special parameter defined. If this parameter is not defined then I want to write the contents of the file as if the handler wasn't even involved. The one problem I'm encountering is that I have a script tag o...