By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,663 Members | 1,477 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,663 IT Pros & Developers. It's quick & easy.

Adding custom server variables from http module

P: n/a
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:

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

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.
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.