httpmodule

Has anyone unit tested a HttpModule in ASP.NET using rhino Mocks framework?

If so can you pls supply a sample test.... ...

implementing interface in an aspx page

for reasons beyond the scope of this discussion (say xcopy an aspx page to a directory, so that we dont have to get a new build out) , we would like to implement an interface in an aspx page.Say, if the page is myPage.aspx, it is usually your class in the codebehind mypage.aspx.cs which implements the interface. When I do something like...

HttpModule and WCF (AspNetCompatibilityRequirementsMode.Allowed)

Hello, I'm hosting WCF services in Asp.net web page in ASP.NET Compatibility Mode (AspNetCompatibilityRequirementsMode.Allowed). I've written simple HttpModule: public class ExceptionInterceptor : IHttpModule { public ExceptionInterceptor() { } public void Dispose() { } public void Init(HttpApplication co...

ASP.NET HttpModules & Server.Transfer / Server.TransferRequest / RewritePath problems...

Hey guys / gals, I will try to be as specific as I can be. I inherited a very antiquated C++ ISAPI filter that secures a classic ASP website and was tasked with the job of creating an HTTPModule to directly replace it. First I hooked into the OnPreRequestHandlerExecute event. I then successfully recreated the calls to the stored proc...

A HttpModule that doesn't work in IIS7

I have a HttpModule that redirects certain URL:s in an ASP.NET WebForms application. It works on my machine with the ASP.NET Development Server. But when I upload it to our Win2k8 server with IIS7, it doesn't seem to react at all. I've put the <add name="Test.Web" type="Test.Web.Core.HttpModules.RedirectOldUrls, Test.Web" /> in the syste...

File Uploads Not Working When Deployed To Server

I recently embarked on the endeavor of creating my own asynchronous file upload components for ASP.NET. I took lessons learned form Darren Johnstone's FileUpload project and created an HttpModule for extracting the files from the submitted data. I got everything working as it should in testing with VS 2008 using the Development Server....

How can I perform XSLT transformations in an HttpModule?

I've been trying to implement server-side XSLT transformations as an IIS HttpModule. My basic approach is to install a new filter at BeginRequest that diverts writes into a MemoryStream, and then at PreSendRequestContent to transform the document using XSLT and write it to the original output stream. However, even without performing the ...

Changes in Page Object in HttpModule is not working/effecting output

I am trying to access the page object in module and change the hyper links urls. Page object is being access properly, but changes I am making are not effecting the output. I mean here I am changing the url to TestURL.aspx, but this is not comming. could anyone help me in this please? namespace Dutt.PageURLBuilder { class PageURLMod...

Why Does Thread.CurrentThread.CurrentCulture Change between Page Rendering and HttpModule.PostRequestHandlerExecute?

I'm creating an HttpModule that needs to know the value of Thread.CurrentThread.CurrentCulture as set in an MVC application. That value is currently being set by the BaseController, but when my HttpModule.PostRequestHandlerExecute() method fires, it reverts to what the Culture was prior to page rendering. I have duplicated this by creat...

In ASP.NET MVC app, simple custom HTTPModule issue

My first custom HTTP Module, baby step 1 - just getting the plumbing down. I'm not getting my string in the 200 response but it is there in 304 responses. Can anyone tell me what I'm missing? My class: namespace WebUI.Models { public class SimpleModule: IHttpModule { public void Dispose() { } publi...

Pass data to a HttpModule

I have a funny little situation on my hands. I have a httpModule on my hands that I have to feed with context relative data. That means that on the page I have to set something that the HttpModule can then react on. If possible I would like to avoid having call context data in the session. Any bright ideas out there. thx for the ans...

Does running a HTTPModule provent IIS Logging?

We are running a site using a custom HTTPModule to do some URL Routing. The problem is this sites traffic is not being logged by IIS. Everything appears to be set up correctly, and other sites on the same server are logging. But the log folder for this site remains empty. (not even the W3SVC... folder is being created!) Is this relat...

HttpModule to Write Out JavaScript Script References to the Response

On my page in the Page_Load event I add a collection of strings to the Context object. I have an HttpModule that will fire EndRequest and retrieve the collection of strings. What I then do is write out a script reference tag (based on the collection of strings) to the response. The problem is that the page reads the script reference but ...

How is the order of execution for HttpModules determined?

Suppose that both FirstModule and SecondModule handle the Application_BeginRequest event. Will it execute in the order defined in the web.config? <httpModules> <add type="MyApp.FirstModule, MyApp" name="FirstModule"/> <add type="MyApp.SecondModule, MyApp" name="SecondModule"/> <add type="OtherApp.OtherModule, OtherApp" name="Other...

How to get original url after HttpContext.RewritePath() has been called.

I am working on a web app which makes use of a 3rd party HttpModule that performs url rewriting. I want to know if there's any way to determine the original url later on in Application_BeginRequest event. For example... Original url: http://domain.com/products/cool-hat.aspx Re-written url (from 3rd party httpmodule): http://domain.co...

IIS7 ISAPI Filter Module & HttpModule Events - How do they line up?

So IIS7 in Integrated Pipeline mode uses a IsapiFilterModule to shim ISAPI filter DLL's and fire off the correct "events" on the filters, which is quite different than previous versions of IIS or IIS7 in classic mode because this means that HttpModules fire off right along side ISAPI filters in Integrated Pipeline mode. So does anyone ...

Load httpmodule to .aspx page

I have created 3 textbox and 2 buttons programatically from HTTPModule. These buttons and textboxes are contained in an html table. It works correctly. I want know how load these table to existing .aspx page <div>***********</div> <div> Some controls contained here <div> I want load HTTPModule table in this place. </div> </div> Pleas...

Request-local storage in ASP.NET (accessible to the code from IHttpModule implementation)

I need to have some object hanging around between two events I'm interested in: PreRequestHandlerExecute (where I create an instance of my object and want to save it) and PostRequestHandlerExecute (where I want to get to the object). After the second event the object is not needed for my purposes and should be discarded either by storage...

Can I stop ASP.NET from returning 'The resource cannot be found.'?

I have installed an HttpModule into my web app that will handle all requests with a given file extension. I want ASP.NET to handle all requests with the extension, regardless of whether there is an underlying file on disk. So, when I added the extension to the 'Application Extension Mappings', I unchecked the 'Verify that file exists' c...

How to modify markup in ASP.NET without using Response Filter

Since ASP.NET response filtering and post-cache substitution are not compatible, I need an alternative way of filtering output. Reference: http://support.microsoft.com/kb/2014472 Is there any way to change the markup without using response filter? ...