httphandler

Disable Cache-Control Header field in custom ASP.NET HttpHandler response

一个人想着一个人 提交于 2020-01-04 02:21:18
问题 How can I completely supress the output of the Cache-Control Header that is returned by my custom HttpHandler in ASP.NET? I know, I can change the header field by modifying response.Cache and response.Cache.SetCacheability, but that will only change the header field, not remove it. That is not what I want. I completely want to make no assumptions about the Cache-Control field and leave it up to the browsers policy. EDIT: The same holds true for HttpResponse.Charset. If no charset is set, ASP

Disable Cache-Control Header field in custom ASP.NET HttpHandler response

谁说我不能喝 提交于 2020-01-04 02:21:08
问题 How can I completely supress the output of the Cache-Control Header that is returned by my custom HttpHandler in ASP.NET? I know, I can change the header field by modifying response.Cache and response.Cache.SetCacheability, but that will only change the header field, not remove it. That is not what I want. I completely want to make no assumptions about the Cache-Control field and leave it up to the browsers policy. EDIT: The same holds true for HttpResponse.Charset. If no charset is set, ASP

jQuery POST. Can't get Request parameters using custom httphandler

天涯浪子 提交于 2020-01-03 18:59:22
问题 I have a jQuery post method with JSON data included. In my httphandler, in the processRequest method, Request["Operation"] is null and none of my data is posted. I am in a SharePoint 2010 environment. public void ProcessRequest(HttpContext context) { try { string operation = context.Request["Operation"]; // Returns null My JavaScript is as follows: function CallService(serviceData, callBack) { $.ajax({ type: "POST", url: ServiceUrl, data: { Operation : "activate"}, contentType: "application

Specifying exact path for my ASP.NET Http Handler

◇◆丶佛笑我妖孽 提交于 2020-01-03 17:01:02
问题 I generate an XML/Google sitemap on the fly using an Http Handler, so that I don't need to maintain an XML file manually. I have mapped my Http Handler to "sitemap.xml" in my web.config like this: <httpHandlers> <add verb="*" path="sitemap.xml" type="My.Name.Space, MyAssembly" /> </httpHandlers> It works nicely. Now, www.mywebsite.com/sitemap.xml sets my Http Handler into action and does exactly what I want. However, this url will do the same: www.mywebsite.com/some/folder/sitemap.xml and I

.ashx cannot find type error on IIS7 , no problems on webdev server

对着背影说爱祢 提交于 2020-01-03 05:16:51
问题 I am trying to make AspNetComet.zip work on IIS7 (a simple comet chat implementation) Here is a portion of my web.config. <system.web> <httpHandlers> <add verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/> </httpHandlers> </system.web> <system.webServer> <handlers> <add name="DefaultChannelHandler" verb="POST" path="DefaultChannel.ashx" type="Server.Channels.DefaultChannelHandler, Server"/> </handlers> </system.webServer> When I publish the website

Generating Thumnail of an Image via Windows API in HttpHandler

那年仲夏 提交于 2020-01-02 23:15:09
问题 I have used the below code to create the thumbnail of an Image inside an ASP.Net application. using System; using System.Diagnostics; using System.Drawing; using System.IO; using System.Runtime.InteropServices; using System.Text; namespace RMA.Shell { public class ShellThumbnail : IDisposable { [Flags] private enum ESTRRET { STRRET_WSTR = 0, STRRET_OFFSET = 1, STRRET_CSTR = 2 } [Flags] private enum ESHCONTF { SHCONTF_FOLDERS = 32, SHCONTF_NONFOLDERS = 64, SHCONTF_INCLUDEHIDDEN = 128, } [Flags

How to serve a View as CSV in ASP.NET Web Forms

徘徊边缘 提交于 2020-01-02 14:07:33
问题 I have a MS SQL view that I want to make available as a CSV download in my ASPNET Web Forms app. I am using Entity Framework for other views and tables in the project. What's the best way to enable this download? I could add a LinkButton whose click handler iterates over the view, writes its CSV form to the disk, and then serves that file. However, I'd prefer not to write to the disk if it can be avoided, and that involves iteration code that may be avoided with some other solution. 回答1: You

How to configure an Http Handler in IIS 7?

混江龙づ霸主 提交于 2020-01-02 04:48:35
问题 Here's what I want to do: I've created a class library project and this has a class implementing the IHttpHandler interface. Let's call this class ZipHandler. Let's say the namespace is Zip. I want that whenever any Http request comes for a zip file, my ZipHandler should handle it, regardless of whether the request is to an Asp.Net application or a normal virtual directory. Queries: Is it possible (it should be given the hype about integrated pipeline etc. in IIS 7)? How to do it? 回答1: Here's

HttpHandler Redirect

▼魔方 西西 提交于 2020-01-01 19:01:29
问题 I want to write an HttpHandler to redirect traffic to various webpages on the server. The user will type in http://www.thisissupposedtoberedirected.com/site12 and should be redirected to the appropiate site, in this example site version 1.2 I know how to program in ASP.NET and C# but I don't seem to grab the finer detail about website management. How can I manage to get this done? What should I do in the web.config? I've read this msdn page but it isn't much help. 回答1: HttpHandlers are

Processing static files via HttpModule in ASP.NET

北城以北 提交于 2020-01-01 03:46:25
问题 I have statiс files in website folder, but need to check permissions for every file. I decided to use HttpModule for that purposes. ASP.NET receives all the http-requests (I used wildcard mapping) and The algorith is the following: HttpModule receives the request HttpModule checks permissions If access is denied then the answer is "Forbidden". If all is OK then httpModule's method just returns. DefaultHttpHandler is automatically used to process request for static files The problem is that