Questions tagged [ihttpmodule]

121 questions
2
votes
1 answer

HttpModule Error event not firing

I have an Asp.Net Web Api project, and i am trying to create a simple IHttpModule for logging errors. The module gets loaded correctly, because i could register to BeginRequest / EndRequest events. However, the Error event is never triggered. I have…
Catalin
  • 11,503
  • 19
  • 74
  • 147
2
votes
1 answer

Can static html pages be post-processed in IIS?

There's a WebForms project, with a bunch of aspx and html pages. I want to postprocess an html markup to be rendered in an HttpModule in a similar way like here. For aspx pages that works. For html pages, however, when I try to read from…
myroman
  • 532
  • 5
  • 11
2
votes
1 answer

IHttpModule Mangling Classic ASP Form Data

I have a classic ASP page that I want to wrap up in some logging using an IHTTPModule. My problem is that if my module accesses any form vars before the page is executed, my ASP page returns an error '80004005' as soon as the first Request.Form is…
Dave
  • 1,068
  • 12
  • 26
2
votes
1 answer

Set IHttpModule.properties in web.config

I have made my own HttpModule called 'JsonLogger' for logging json requests and responses. For the logging I need a connectionstring. To find the connectionstring, I added one in my web.config and I get it by code. web.config
Kjell Derous
  • 502
  • 1
  • 6
  • 19
2
votes
1 answer

IHttpModule behaves differently on different servers

I'm developing an application and I'm debugging the code with Visual Studio 2013 and Visual Studio 2010 and the code behaves differently with the two programs. In VS 2010, after the code behind has been executed and the page has been built, the…
Luke
  • 1,633
  • 3
  • 23
  • 37
2
votes
1 answer

When authenticating WCF service on IIS AuthenticateRequest is called only first time

I have a working implementation of OData WCF service which now need to be published in IIS with basic custom authentication. Implementation is based on Microsoft OData example and works perfectly fine under the IIS Express. When I publish it to IIS…
too
  • 3,009
  • 4
  • 37
  • 51
2
votes
1 answer

Order of execution of couple httpModules when registered to same EventHandler

I am writing a httpModule and the plan is to attach the module to PreRequestHandlerExecute event, while I see that there is already existing module attached to the same event. My question what would be the order of execution of httpModules which…
Dibyendu
  • 55
  • 1
  • 9
2
votes
1 answer

Frame Redirect in C#

I would like to execute a frame redirect in C# from my managed module for the IIS 7. When I call context.Response.Redirect(@"http://www.myRedirect.org");the correct page is shown but also the address is shown in the browser. And that is exactly what…
Simon Linder
  • 3,378
  • 4
  • 32
  • 49
2
votes
1 answer

Detect mapped virtual directories from an ihttpmodule in a c# .net application

I have a .net website which contains an IHttpModule I wrote to do certain tasks (authorisation etc). But within the website there are a number of virtual directories that are mapped to third party applications which unfortunately I can't change or…
vitch
  • 3,215
  • 3
  • 25
  • 26
1
vote
3 answers

How2: what event to hook in HttpModule for putting js links into head element

I want to have HttpModule to inject javascripts, css links into HEAD element from some simple config data. I am not sure which event I should hook? Curently I use - context.PreRequestHandlerExecute for changing the masterpage dynamically -…
Jaroslav Urban
  • 1,269
  • 3
  • 20
  • 32
1
vote
2 answers

ASP.NET MVC extract controller, action and value from URL

I m writing an httpModule to intercept the request that is coming to ASP.NET MVC application. Is there an easy way to figure out what part of the URL constitutes area, controller, action and the actual value.…
akshay
  • 21
  • 3
1
vote
0 answers

ASP.NET Problem with IHttpModule catch error

I made an API project with basic authentication. To manage basic authentication I created a module that extends the IHttpModule class. The module is composed of an Init as follows public void Init(HttpApplication context) { //…
1
vote
0 answers

Is ReleaseRequestState called multiple times for each Request received by IIS?

I am writing an HttpModule in VS2010/ASP.NET 4.0 for use with IIS 7. The module is going to enforce query string security by encrypting query strings. I would like this module to be completely independent of as well as transparent to the website, so…
Umar Farooq Khawaja
  • 3,925
  • 1
  • 31
  • 52
1
vote
0 answers

ASP.Net: Is it possible to use Windows authentication and set HttpContext.Current.User to a GenericPrincipal

I am trying to do something a bit hacky - but feels like it might be doable. Essentially I have an ASP.Next application that uses Windows authentication. In some scenarios, I want privileged (admin) users to be able to "spoof" different users (use…
Chris Fewtrell
  • 7,555
  • 8
  • 45
  • 63
1
vote
0 answers

How to modify request in a class by inheriting to IHttpModule

I have created a class that inherit for IHttpModule. The class currently fetches the request information and simultaneously log information with that incoming request. I want to modify that request so that when it call my main APi, it should receive…
Running Rabbit
  • 2,634
  • 15
  • 48
  • 69
1 2
3
8 9