Adding Class .cs Files to Inline ASPX Site?

  • Thread starter Thread starter lucius
  • Start date Start date
L

lucius

I am working with a site that uses inline code in .aspx files and C#
code in the header area. I would like to add some HTTPModules and
HttpHandlers but am not sure where to put the .cs files and how to
reference them in the web.config - can anyone show a sample?

Thanks.
 
Hi Lucius,

As for ASP.NET 2.0 website application, you can create a custom httphander
or httpModule in App_Code folder and use them in your application direclty.
What you need to do is the same a define a custom handler/module in an
external assembly. e.g.

Suppose you've created a "SimpleHandler" custom httphandler class in
App_code folder, you can reference it in webconfig as below:

=============
<httpHandlers>
<add verb="*" type="SimpleHandler, App_Code"
path="simplehandler.aspx"/>
............
=======================

Also, do not forget to add the extension mapping to aspnet_isapi.dll if the
extension is not originally mapped to ASP.NET runtime engine.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Lucius,

Does the suggestion helps you? If you have any further questions on this,
please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top