httphandler

Unit testing http handlers?

My current project based in Asp .net makes considerable use of Http handlers to process various requests? So, is there any way by which I can test the functionality of each of the handlers using unit test cases? We are using Nunit and Moq framework to facilitate unit testing. ...

Silverlight Calling an HttpHandler

I have a Silverlight 2 application that I'm trying to get to invoke an HttpHandler by using WebClient. I have the HttpHandler just sending an email that says test when invoked. If I hit it via a browser, I get the email. However, using a WebClient object with a delegate, I can't seem to get it to connect. I've started to think about us...

Receiving "Path 'OPTIONS' is forbidden." Exception in ASP.NET website

I am getting the error System.Web.HttpException: Path 'OPTIONS' is forbidden. since we moved our website over to a new server setup. I am unable to recreate the error but I am receiving emails for this exception at least a few times a day. Any ideas what could be causing this and how I can fix it? EDIT: Stack Trace: at System.Web.HttpM...

Http Hanlder must be reset with each deployment. How can I add this functionality to the web.config

My application is a dotnet 4 hybrid - MVC in some areas, web forms in others. This application was recently upgraded to dotnet 4 and includes a lot of older code and some mismatched parts. Unfortunately it includes a telerik component that requires me to run the Application pool in classic mode. In order to fix this (in IIS7) I have to ...

Streaming PDF via invocation of HTTPHandler using $.get into object element

What I am trying to do is invoke an HTTPHandler via the $.get method of jQuery which will stream back a PDF and display it in a web page using an object element. My previous method of setting the src attribute of an IFrame to be the result of a handler invocation works, but I would like cross-browser completion notification, so have move...

Developing a myspace application with .NET back end - Help

Okay, so here z the scenario, I have to create a myspace application which will have a .NET backend. from my current research n all I have found that this shud be my architecture: A .NET application which uses handlers and the handlers use a function to write the output in an XML file on the server A javascript front end for the myspac...

How to server-side cache ASP.NET custom HttpHandler response

I've got a custom HttpHandler in my ASP.NET application, that basically builds and returns a javascript object. I have no experience with server-side caching, and my (possibly incompetent) google searches aren't returning anything basic enough to get me started. Could anyone provide a very simple example to give me an idea of how to ac...

Problem mapping HttpHandler --> HTTP Error 404 Not Found

I am having problems trying to map an HttpHandler in the web.config. This is the relevant config bit: <httpHandlers> <add verb="*" path="*.hndlr" type="MyAssembly.MyHandler, MyAssembly" validate="false" /> </httpHandlers> When I navigate to http://localhost/myApp/whatever.hndlr I am getting a server error 404 (not found). It's the...

Possible to map a new file extension to an existing handler in ASP.NET?

I have a scenario where my application is going to be publishing services that are consumed by both PC's and mobile devices, and I have a HTTPModule that I want to only perform work on only the mobile requests. So I thought the best way of doing this was to point the mobile requests to a different file extension and have the HTTPModule ...

Optimize LINQ Query for use with jQuery Autocomplete

I'm working on building an HTTPHandler that will serve up plain text for use with jQuery Autocomplete. I have it working now except for when I insert the first bit of text it does not take me to the right portion of the alphabet. Example: If I enter Ne my drop down returns Nlabama Arkansas Notice the "N" from Ne and the "labam...

Deploying an HttpHandler web service

I am trying to build a webservice that manipulates http requests POST and GET. Here is a sample: public class CodebookHttpHandler: IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { //DoHttpPostLogic(); } else if (context.Reque...

httpModules not working on iis7

Hi, I have the following module public class LowerCaseRequest : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(this.OnBeginRequest); } public void Dispose() { } public void OnBeginRequest(Object s, EventArgs e) { Ht...

Why is this class library dll not getting information from app.config

I am developing a custom HttpHandler, to do so I write a C# Class Library and compile to DLL. As part of this I have some directory locations which I want not hard coded in the app, so i'm trying to put it in the app.config which I've used before. Before this has worked by just going building the app.config: <?xml version="1.0" encodi...

How can I debug this web service http handler?

Hello everyone, I am building a Httphandler following these instructions here It manipulates HTTP POST and HTTP GET. I have a client with two buttons two POST and GET. After i've tested and happy everythings working I move it from localhost to IIS. Now when I do this I get an exception in the POST handler code. How on earth can I de...

Secure comunication Between a Web Page and the Server

I'm wondering if theres already a combo let say jQuery - Some C# DLL to proive a secure both way communication between ASPX forms with jQuery and a control layer based on ashx files with C# classes... [From comment below] Well I see I have to be more specific. The are things like sniffers on simple network analysis tools even like Fir...

Problem with webclient: Expectation failed?

Hello everyone, I have a custom Http Handler which manipulates HTTP POST and GET. I got the project working on a seperate isolated server now need to put it in production... using (var client = new WebClient()) { client.Credentials = CredentialCache.DefaultCredentials; client.Uplo...

How can I pass a raw System.Drawing.Image to an .ashx?

I am developing an application that stores images as Base64 strings in xml files. I also want to allow the user to crop the image before saving it to the file, preferably all in memory without having to save a temp file, and then delete it afterwards. In order to display the newly uploaded image, I need to create a HTTP handler that I ...

How to handle null return from custom HttpHandler in asp.net?

I'm using a custom ashx HttpHandler to retrieve gif images from a database and show it on a website - when the image exists, it works great. However, there are cases when the image will not exist, and I'd like to have the html table holding the image to become invisible so the "image not found" icon is not shown. But since the HttpHan...

Loading images faster in Gridview

I have a gridview which displays data for all employees and their images (stored in database). The images take more time to render completely when i click sort or paging or reload. I'm using httphandler to display image as stream. Is there a way i can speed up this image loading? ...

How do I register multiple paths for a HttpHandler in IIS7?

I have a HttpHandler that resizes images based on the querystring, so requesting something like: http://server/image.jpg?width=320&amp;height=240 will give you a resized image that's 320x240. In the IIS Manager, under Handler Mappings, I mapped my handler's path as *.jpg,*.gif,*.bmp,*.png. However, this doesn't activate the handle...