HTTPModule and App_code ASP.NET 2.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Samuel

    HTTPModule and App_code ASP.NET 2.0

    nHi,

    is it possible to add pure code to APP_Code folder to act as an HTTPModule?
    If so, how do I reference it in web.config? I know global.asax is the place
    for such thing but I am just wondering.
  • Rick Strahl [MVP]

    #2
    Re: HTTPModule and App_code ASP.NET 2.0

    Hi Samuel,

    APP_CODE code generates into a fixed filename of APP_CODE.DLL so you can use
    that name for the assembly in the Web apps bin directory.

    +++ Rick ---

    --

    Rick Strahl
    West Wind Technologies
    Home of Rick Strahl's company site. Find products, tools and development service, read our development blogs and white papers about Web and Service development on the Microsoft and open Web stack.





    "Samuel" <programmer@nos pam.nospam> wrote in message
    news:90AECFFA-C3D3-4E7A-A387-8C3C28B42EF8@mi crosoft.com...[color=blue]
    > nHi,
    >
    > is it possible to add pure code to APP_Code folder to act as an
    > HTTPModule?
    > If so, how do I reference it in web.config? I know global.asax is the
    > place
    > for such thing but I am just wondering.[/color]


    Comment

    • Samuel

      #3
      Re: HTTPModule and App_code ASP.NET 2.0

      Thanks Rick for your help. It works well.

      One question: what's the difference now for global.asax and httpmodules
      created in app_code in terms of functionality? I know the way we code the two
      are different, but what's the main difference now for the two methods in .net
      2.0?

      "Rick Strahl [MVP]" wrote:
      [color=blue]
      > Hi Samuel,
      >
      > APP_CODE code generates into a fixed filename of APP_CODE.DLL so you can use
      > that name for the assembly in the Web apps bin directory.
      >
      > +++ Rick ---
      >
      > --
      >
      > Rick Strahl
      > West Wind Technologies
      > www.west-wind.com
      > www.west-wind.com/weblog
      >
      >
      >
      > "Samuel" <programmer@nos pam.nospam> wrote in message
      > news:90AECFFA-C3D3-4E7A-A387-8C3C28B42EF8@mi crosoft.com...[color=green]
      > > nHi,
      > >
      > > is it possible to add pure code to APP_Code folder to act as an
      > > HTTPModule?
      > > If so, how do I reference it in web.config? I know global.asax is the
      > > place
      > > for such thing but I am just wondering.[/color]
      >
      >
      >[/color]

      Comment

      • Brock Allen

        #4
        Re: HTTPModule and App_code ASP.NET 2.0

        HttpModules and code in global.asax can handle any per-request events fired
        by the HttpApplication (like BeginRequest, EndRequest, etc). Only global.asax
        can handle Application_Sta rt, Application_End , Session_Start and Session_End.
        global.asax is only deployed in the root of your virtual directory whereas
        modules are packaged as assemblies so they can be deployed to ~/bin or in
        the GAC. Modules can be configured machine or site wide as well.

        -Brock
        DevelopMentor



        [color=blue]
        > Thanks Rick for your help. It works well.
        >
        > One question: what's the difference now for global.asax and
        > httpmodules created in app_code in terms of functionality? I know the
        > way we code the two are different, but what's the main difference now
        > for the two methods in .net 2.0?
        >
        > "Rick Strahl [MVP]" wrote:
        >[color=green]
        >> Hi Samuel,
        >>
        >> APP_CODE code generates into a fixed filename of APP_CODE.DLL so you
        >> can use that name for the assembly in the Web apps bin directory.
        >>
        >> +++ Rick ---
        >>
        >> --
        >>
        >> Rick Strahl
        >> West Wind Technologies
        >> www.west-wind.com
        >> www.west-wind.com/weblog
        >> "Samuel" <programmer@nos pam.nospam> wrote in message
        >> news:90AECFFA-C3D3-4E7A-A387-8C3C28B42EF8@mi crosoft.com...
        >>[color=darkred]
        >>> nHi,
        >>>
        >>> is it possible to add pure code to APP_Code folder to act as an
        >>> HTTPModule?
        >>> If so, how do I reference it in web.config? I know global.asax is
        >>> the
        >>> place
        >>> for such thing but I am just wondering.[/color][/color][/color]



        Comment

        Working...