Adding Class .cs Files to Inline ASPX Site?

Discussion in 'ASP .Net' started by lucius, Jul 18, 2007.

  1. lucius

    lucius Guest

    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.
    lucius, Jul 18, 2007
    #1
    1. Advertising

  2. 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.
    Steven Cheng[MSFT], Jul 18, 2007
    #2
    1. Advertising

  3. 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.
    Steven Cheng[MSFT], Jul 20, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John M
    Replies:
    1
    Views:
    1,129
    Kumar Reddi
    May 29, 2005
  2. Abhi
    Replies:
    2
    Views:
    734
    E. Robert Tisdale
    Jul 3, 2003
  3. Alvin
    Replies:
    7
    Views:
    473
    E. Robert Tisdale
    May 6, 2005
  4. Replies:
    3
    Views:
    456
  5. Sven Wolf
    Replies:
    7
    Views:
    207
    Tad McClellan
    Dec 3, 2004
Loading...

Share This Page