httphandler

Parse error with Generic Handler using IIS

会有一股神秘感。 提交于 2019-12-13 12:18:53
问题 What made me curious is that the generic handler works just fine when I'm running the Web App in a Visual Studio ASP.NET Development Server. When I change the config to run it directly from IIS the handler just dies. It's an image handler, it writes back an array of bytes to be rendered in an Image object. As I said, it works fine in VS Development Server, but fails on IIS. It doesn't even get called... The error I get when I'm trying to call it directly is this: Parser Error Description: An

Custom HTTP handler configuration fail

落花浮王杯 提交于 2019-12-13 06:27:14
问题 I am developing an ASP .Net website. I have created a custom HTTP handler to respond to requests aiming resources with .videoImage extension. Here are the first lines of the file corresponding to my handler : <%@ WebHandler Language="C#" Class="CompleteSubtitles.VideoImage" %> using System; using System.Web; using System.IO; using SubtitleSounds.DataManagement; namespace CompleteSubtitles { public class VideoImage : IHttpHandler { ... } } The handler file is located in a subfolder of the

Using a colon (:) in a url with ASP.NET/IIS

青春壹個敷衍的年華 提交于 2019-12-13 05:44:25
问题 I'm implementing a custom controller in ASP.NET MVC and really want to be able to use a colon in the urls, so that I can identify class/column names and their values, like so: http://example.com/user:chaiguy ...but apparently ASP.NET or IIS doesn't allow colons in urls. I did some digging and apparently it's considered a security issue, but , I'm using MVC and am handling all url paths manually (just treating them as strings), and not relating them to the file system, so I'm pretty sure this

asp.net HTTPHandler prevents page from loading

佐手、 提交于 2019-12-13 05:29:48
问题 I have an ASP:NET web project with a simple HTTPHandler which filters out requests from outside IPs. The code itself works, but the HTTPHandler prevents my page from loading . No error. No infinite load. There's just a blank page. If I remove the reference in the config, it loads perfectly fine. It's definitely caused by the HTTPHandler. I've also stepped through the handler and the code is definitely reached, it's just that when the handler is done, the page doesn't load like it should. Here

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

北慕城南 提交于 2019-12-13 05:23:25
问题 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 moved to using $.get(). Sample code: function buttonClick() { $.get("/PDFHandler.ashx", {}, function(data, textStatus, XMLHttpRequest) { var pdfObjectString = "

How can I programmatically modify an aspx file content before the handler handle it?

无人久伴 提交于 2019-12-13 03:56:24
问题 The reason I need to modify the content of an aspx (not physically, but change the content in the memory) is because there are certain custom tags I made needs to be parsed to the correct data before the entire aspx is handled by the HttpHandler. Is there a way for that? 回答1: You can use Response Filters (HttpFilter) and modify content on the fly, basically after response is formed, before EndRequest your filter is called (it's a stream descendant) and you can modify it as you wish. In the

Master Slave DropDownList Use jQuery Ajax ($.ajax) and HttpHandler

两盒软妹~` 提交于 2019-12-13 03:53:30
问题 I have 2 DropDownLists and a jQuery script with HttpHandler in server side, there is a problem in binding Slave Dropdown one. this is my Default.aspx code include jQuery Script: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Sample001.Default" %> <script src="jquery-1.6.4.min.js" type="text/javascript"></script> <html xmlns="http:/

Create Generic HTTPHandler in asp.net with multiple values using AJAX call

喜夏-厌秋 提交于 2019-12-13 02:37:29
问题 I want to create File Upload Handler in VB.NET. What I want to do is pass some 5 values and a file uploaded in file upload control through AJAX call using jQuery. But my problem is I don't know how to pass these values + file to ASHX and how to retrieve values in Generic HTTPHandler . What I've done yet is: var fileType = '#' + $('input[type=file]')[0].id; if (fileType != null && typeof(fileType)!='undefined') { document.getElementById('hdnFileName').value = $(fileType).val().split('\\').pop(

Configuring ImageResizer Web.config To Only Work On Certain Directories

▼魔方 西西 提交于 2019-12-13 01:44:09
问题 Product Using: ImageResizer.dll from http://imageresizing.net I have a website for a client that I use this product to dynamically resize images for their online shopping cart. The product works great! I have recently added a Custom HTTPHandler ( MyCustomSecurityHandler ) to control access to the images in particular directory that need to be secured. The code for MyCustomSecurityHandler works fine as long as I don't try to access the image using the QueryString parameters "width" or "height"

Viewstate in a .ashx Handler?

萝らか妹 提交于 2019-12-12 11:37:25
问题 I've got a handler (list.ashx for example) that has a method that retrieves a large dataset, then grabs only the records that will be shown on any given "page" of data. We are allowing the users to do sorting on these results. So, on any given page run, I will be retrieving a dataset that I just got a few seconds/minutes ago, but reordering them, or showing the next page of data, etc. My point is that my dataset really hasn't changed. Normally, the dataset would be stuck into the viewstate of