English 中文(简体)
IIS 7 Http Handler development issue
原标题:

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 to develop an ASP.Net web site. I want to develop an Http module, which could inspect whether incoming request has some specific http header (e.g. CustomerID) and if do not have such header, I will redirect user request to some other pages.

I think I should develop by using Http Modules in IIS 7.0 integrated mode? Please correct me if I am wrong or there is simplier solutions. Any reference samples or tutorials? I am new to Http Module development in IIS 7.0.

最佳回答

There are a number of articles that describe how to create standard HttpModules for ASP.NET. One such article can be found in the ASP.NET infrastructure MSDN Library titled "Walkthrough: Creating and Registering a Custom HTTP Module".

Make sure that you follow the steps to register your module with IIS 7 Integrated mode on that walkthrough or you will end up with an error similar to the following:

"HTTP Error 500.0 - Internal Server Error Description: This application is running in an application pool that uses the Integrated .NET mode. This is the preferred mode for running ASP.NET applications on the current and future version of IIS. In this mode, the application should not specify ASP.NET module components in the / configuration section. Instead, it should use the / configuration section to load ASP.NET module components."

You can find another article on the IIS.NET site which has detailed information on how to create both modules and handlers for IIS 7. This article is titled "Developing IIS 7.0 Modules and Handlers with the .NET Framework"

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签