Adding custom server variables from httpmodulehttp://forums.asp.net/t/367445.aspx/1?Adding+custom+server+variables+from+httpmoduleWed, 15 Oct 2003 18:43:26 -0400367445367445http://forums.asp.net/p/367445/367445.aspx/1?Adding+custom+server+variables+from+httpmoduleAdding custom server variables from httpmodule I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter added custom headers to the response which could later be accessed by the asp page. ISAPI Filter: pvPrep->SetHeader(pfc, "Instance-Id:", info->instance_id); pvPrep->SetHeader(pfc, "Company-Id:", info->company_id); pvPrep->SetHeader(pfc, "Primary:", info->hostname); pvPrep->SetHeader(pfc, "Profile:", buffer); These could then be accessed in asp by calling: Request.servervariables("HTTP_INSTANCE_ID") Request.servervariables("HTTP_COMPANY_ID") Request.servervariables("HTTP_PRIAMRY") Request.servervariables("HTTP_PROFILE") I've tried adding headers to the response in my httpmodule with the following code: _app.Context.Response.AddHeader("INSTANCE-ID", instance_id) _app.Context.Response.AddHeader("COMPANY-ID", company_id) _app.Context.Response.AddHeader("PRIMARY", hostname) and when I view the headers in a tool like wfetch the headers are there but they can't be accessed thru the servervariables object in the resulting page. BTW, I did setup IIS to use the aspnet_isapi.dll to process asp pages. Anybody have any thoughts or Ideas on how I can make this work or what I'm doing wrong? I can't use viewstate or session variables or anything like that due to the way the original asp app uses these variables. 2003-10-15T18:42:54-04:00