ASP.NET HTTP Modules are classes which implement the System.Web.IHttpModule interface.
Questions tagged [httpmodule]
834 questions
8
votes
3 answers
Is it possible to modify the content of HttpRequest POST in an IIS HttpModule?
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…

Adam
- 605
- 1
- 6
- 7
8
votes
5 answers
asp.net file downloading - track downloaded size
I am trying to design a system for something like this with ASP.net/C#.
The users pay for downloading some content (files- mp3s/PDFs,doc etc).I should be able to track the number of bytes downloaded by the user. If the number of bytes downloaded…

ram
- 11,468
- 16
- 63
- 89
8
votes
3 answers
HTTPModules and Global.asax -- ASP.NET Page Life cycle
I have read the beautiful article about Asp.Net Page life Cycle http://www.codeproject.com/Articles/73728/ASP-NET-Application-and-Page-Life-Cycle.
My understanding is the request passes through MODULE(BeginRequest,authentica,author,prehandler...)…

Peru
- 2,871
- 5
- 37
- 66
8
votes
3 answers
How to analyze the performance of requests in ASP.NET MVC application?
I would like to capture the hit time, processing time, memory consumption and response time of requests in ASP.NET MVC application.
Is there any way or tool to perform this?

vinodpthmn
- 1,062
- 14
- 28
8
votes
4 answers
Why HttpContext.Current.Handler is null?
I'm trying to access a Page within an HttpModule and I think I should do this by calling HttpContext.Current.Handler (This should reference the current page) but I'm getting null all the time.
I'm developing using .Net 3.5 framework.
I'm checking…

Paleta
- 970
- 2
- 13
- 27
7
votes
2 answers
What's the performance difference between HttpModule and Global.aspx?
I have made a web app where I am using a module which redirects without "www" urls (http://example.com/) to with "www" urls (http://www.example.com/). But as I am on shared hosting server, where I don't have permission to implement a HttpModule,…

djmzfKnm
- 26,679
- 70
- 166
- 227
7
votes
2 answers
Event handlers can only be bound to HttpApplication events during IHttpModule initialization
I am getting the following error
'Event handlers can only be bound to HttpApplication events during IHttpModule initialization.' at the following code (line in bold or double **)
protected void Application_BeginRequest(object sender, EventArgs…

Zohaib
- 496
- 7
- 21
7
votes
2 answers
Server.TransferRequest() and the http status code
I had to implement a custom HttpModule to handle a 404 error in Sharepoint.
It listens for the PreSendRequestContent event, and looks for a 404 status code. If one is found it does a TransferRequest.
void App_PreSendRequestContent(object sender,…

ScottE
- 21,530
- 18
- 94
- 131
7
votes
3 answers
How to protect application pools from session serialization exceptions?
We're using an Out-of-Process Session Provider (ScaleOut) for an ASP.NET application and we've noticed that when an object that's not correctly setup for de-serialization inadvertently makes its way into session it will eventually cause the entire…

Nariman
- 6,368
- 1
- 35
- 50
7
votes
4 answers
Is HttpModule shared among working threads?
Do I have to lock access to instance members?
Example:
public class HttpModule : IHttpModule
{
//...
Dictionary foo;
void UseFoo(int a, int b)
{
foo[a] = b;
}
}

TN.
- 18,874
- 30
- 99
- 157
7
votes
1 answer
Can I get the OWIN cookie and decrypt it to get claims from it in BeginRequest?
I am implementing the new ASP.NET Identity 2.0 Framework in an existing website uses CA's Identity Minder which primarily uses Request.ServerVariables to power all the controls.
What I am trying to do is populate the Request Headers with the same…

vipergtsrz
- 1,061
- 1
- 12
- 17
7
votes
3 answers
MVC 3/4 HttpModule or ActionFilter
I need to check some stuff (Cookies) for each request coming to my application.
In ASP.NET we've used HttpModule for this task , the question what should be used in MVC ? Some Global Filter , or I can Use HttpModuler as well, is there Any difference…

StringBuilder
- 1,619
- 4
- 32
- 52
7
votes
2 answers
Access Session Variable from HTTPModule
How can I access session variable from the HttpModule?
I set following session variable in .cs page, which I want access in the HttpModule:
Session["username"] = "BLAH"

ysr
- 127
- 1
- 7
6
votes
1 answer
I can’t find the about UrlRoutingModule When Create a Asp.net MVC 3 Application
I have downloaded the source code of the MVC 3 to learn How it runs .
Many people said that the MVC interceptes Http’s requests by the UrlRouting Moudle Class.
I know when you custom a HttpModule ,you need to register it like…

DotDot
- 653
- 1
- 7
- 15
6
votes
2 answers
IIS treats double-encoded forward slashes in URLs differently on the first request than it does on subsequent requests
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…

George Stocker
- 57,289
- 29
- 176
- 237