httpmodule

Large File Upload Using HttpHandler or HttpModule?

ⅰ亾dé卋堺 提交于 2019-11-30 16:44:14
I have a webform application. It required to be able to upload large file (100MB). I intended to use httpHandler and httpModule to split the file to chunk . I also had a look at http://forums.asp.net/t/55127.aspx But it is a very old post and I've seen some example on the internet using httpHandler. e.g. http://silverlightfileupld.codeplex.com/ I'm not sure httpModule is still better then httpHandler. Since httpModule apples to the request of the whole application, and I just want it apply to specify page. Can anybody explain the shortcoming of httpHandler for large file upload clearly (if it

HttpModule - get HTML content or controls for modifications

ε祈祈猫儿з 提交于 2019-11-30 16:11:14
问题 Tried something like this: HttpApplication app = s as HttpApplication; //s is sender of the OnBeginRequest event System.Web.UI.Page p = (System.Web.UI.Page)app.Context.Handler; System.Web.UI.WebControls.Label lbl = new System.Web.UI.WebControls.Label(); lbl.Text = "TEST TEST TEST"; p.Controls.Add(lbl); when running this I get "Object reference not set to an instance of an object." for the last line... How do I get to insert two lines of text (asp.net/html) at specific loactions in the

VS2010 development web server does not use integrated-mode HTTP handlers/modules

穿精又带淫゛_ 提交于 2019-11-30 08:13:57
I am developing an ASP.NET MVC 2 web site, targeted for .NET Framework 4.0, using Visual Studio 2010. My web.config contains the following code: <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="XhtmlModule" type="DomenicDenicola.Website.XhtmlModule" /> </modules> <handlers> <add name="DotLess" type="dotless.Core.LessCssHttpHandler,dotless.Core" path="*.less" verb="*" /> </handlers> </system.webServer> When I use Build > Publish to put the web site on my local IIS7 instance, it works great. However, when I use Debug > Start Debugging , neither the HTTP handler

IoC Dependency injection into Custom HTTP Module - how? (ASP.NET)

家住魔仙堡 提交于 2019-11-30 07:27:09
问题 I have a custom HTTP Module. I would like to inject the logger using my IoC framework, so I can log errors in the module. However, of course I don't get a constructor, so can't inject it into that. What's the best way to go about this? If you need the specific IoC container - I'm currently using Windsor, but may soon move to AutoFac. Thanks 回答1: I just answered this question on my blog. See also http://lozanotek.com/blog/archive/2009/08/19/Autowire_IHttpModules_with_IoC.aspx 回答2: First time I

HttpModule not running with Visual Studio

怎甘沉沦 提交于 2019-11-30 06:24:47
I am using an HttpModule to do some URL shortening on my site. I am using Visual Studio 2008 and IIS 7, and .Net 3.5. When the module is specified in the system.webServer element of web.config, and the site is run in IIS, it works fine. The config looks like this: <system.webServer> <modules> <add name="MinimizeModule" type="ClipperHouse.UrlMinimizer.MinimizeModule" /> </modules>... My module attaches to the BeginRequest event, everything works. However, I can't get it to run using the built-in VS web server (Cassini). I tried moving the module config to the system.web element in web.config,

How do I retrieve response html from within a HttpModule?

拟墨画扇 提交于 2019-11-30 05:10:17
Here is what I'm specifically trying to do: I have written a HttpModule to do some site specific tracking. Some old .aspx pages on our site are hard coded with no real controls, but they are .aspx files so my module still runs when they are requested. My module's handler is attached to the PostRequestHandlerExecute, so I believe what will be sent back to the requester should have already been determined. I need to be able to extract whatever string is in the title tag. So if <title>Chunky Bacon</title> is sent to the requester in the final rendered HTML. Then I want "Chunky Bacon". Ideas? Fun

IIS treats double-encoded forward slashes in URLs differently on the first request than it does on subsequent requests

送分小仙女□ 提交于 2019-11-30 04:50:49
问题 Recently my team was asked to implement an HttpModule for an ASP.NET MVC application that handled double-encoded URLs on IIS 7 and .NET 3.5. Here's the crux of the problem: We sometimes get URLs that have double-encoded forward slashes that look like so: http://www.example.com/%252fbar%5cbaz/foo There are other formats that we have to handle as well, but they all have something in common, they have a double-encoded forward slash. To fix this, we wrote an HttpModule that only acts when a URL

HttpModule Init method is called several times - why?

淺唱寂寞╮ 提交于 2019-11-30 04:20:15
I was creating a http module and while debugging I noticed something which at first (at least) seemed like weird behaviour. When i set a breakpoint in the init method of the httpmodule i can see that the http module init method is being called several times even though i have only started up the website for debugging and made one single request (sometimes it is hit only 1 time, other times as many as 10 times). I know that I should expect several instances of the HttpApplication to be running and for each the http modules will be created, but when i request a single page it should be handled

Is it possible to modify the content of HttpRequest POST in an IIS HttpModule?

混江龙づ霸主 提交于 2019-11-30 04:07:44
问题 I need to modify the content of certain HttpRequests (SSAS connection strings) in IIS. Basically, I need to add an element to the SOAP contained in the request. My approach so far has been to add a Filter to the HttpRequest, and perform the change in the filter's Read method. As far as I can tell, though, Read is never being executed. My understanding of the Request.Filter is that it gets read from when IIS processes the request, so IIS should see my modified Request. Is what I'm trying to do

BUG: IIS7 managed requests

此生再无相见时 提交于 2019-11-30 04:05:42
( I don't know whether should I also post this question to ServerFault, since it's about IIS configuration? ) In IIS7 we can tell a module to run for managed content (thus speeding up static content serving) by: <modules> ... <add name="WhateverName" type="WhateverType" preCondition="managedHandler" ... </modules> But. This works fine and dandy as long as there's also a file name (with extension) in the requested URL. If it's omitted it IIS7 will think you want static content and managed modules won't run. http://localhost/ <-- this one will skip managed handlers http://localhost/default.aspx