Adding Class .cs Files to Inline ASPX Site?

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.
 
S

Steven Cheng[MSFT]

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.
 
S

Steven Cheng[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top