Hello,
Thanks for your answer I just did that, and I also registered the module in the Web.config, when I run the code the following error comes out:
Error Line: --------- Dim headers As NameValueCollection = response.Headers
Error Description-- This operation requires IIS integrated pipeline mode.
At the end of my message I paste the portion of my code for you to see.
I try also with: response.AddHeader("variable","value") and it do not send the header in the response.
Thanks very much in advance for your help
Armando
-----Code ----
Public
Class MyHttpHandler
Implements IHttpModule
Public Sub Init(ByVal application As HttpApplication) Implements IHttpModule.Init
AddHandler application.BeginRequest, AddressOf Me.OnInit
End Sub
' event handler.Private Sub OnInit(ByVal [source] As [Object], ByVal e As EventArgs)
Dim application As HttpApplication = CType([source], HttpApplication)
Dim response As HttpResponse = application.Context.Response
Dim headers As NameValueCollection = response.Headers Dim t As Type = headers.GetType Dim p As PropertyInfo = t.GetProperty("IsReadOnly", BindingFlags.Instance Or BindingFlags.IgnoreCase Or BindingFlags.NonPublic Or BindingFlags.FlattenHierarchy)
p.SetValue(headers,
False, Nothing)
headers.Add("USER_VAR", "MyName")
End SubPublic Sub Dispose() Implements IHttpModule.Dispose
End Sub End Class