473,765 Members | 2,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Nov 19 '05 #1
3 2016
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" <pr********@nos pam.nospam> wrote in message
news:90******** *************** ***********@mic rosoft.com...
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.

Nov 19 '05 #2
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:
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" <pr********@nos pam.nospam> wrote in message
news:90******** *************** ***********@mic rosoft.com...
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.


Nov 19 '05 #3
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
http://staff.develop.com/ballen
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:
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" <pr********@nos pam.nospam> wrote in message
news:90******** *************** ***********@mic rosoft.com...
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.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2578
by: nail | last post by:
Folks, I develop a HttpModule and it works correct, but one problem is occurs. After I register the httpmodule in the web.config, my pages (not testing http://localhost/site but http://my_machine_name/site) show problems when refresh the page. I guess some kind of javascript problems with the postback methods. Someone has any idea how can i fix it? Thanks
4
3912
by: Danny W | last post by:
Hi There! Is it possible to use HttpModule to replace the built-in ASP.NET Session object? I want to write a HttpModule that will handle storing and retrieving of session values from an external database. For example, when a page set values to Session object such as Session("somevar")=1 then I want my HttpModule to get notified and store the value into the external database. The same for "getting" the variable, I want my own...
2
2141
by: Simon-Pierre Jarry | last post by:
Hi, I created a custom HttpModule for managing the security of my application. in "Init" sub, I regsiter the events doing that : Public Sub Init(ByVal context As System.Web.HttpApplication) Implements IHttpModule.Init httpApp = context
2
4586
by: walter | last post by:
Hi there, I know there is pool of HttpApplications, and for each request coming in, HttpRuntime will dedicate one from pool to serve the request. My questions are : 1. since HttpModule is plug into the process, does each instance of HttpApplication keep its own set of HttpModule instance or HttpModules are shared among all HttpApplication instances? 2. In case of HttpApplication keep its own set of HttpModule, does the HttpModule...
1
1902
by: Faraz | last post by:
Hi everyone, I am running into a slight problem. My understanding is that a custom HttpModule will run for every request made to the server, regardless of the extension. I do not experience this behavior. My module only runs for the extensions handled by the aspnet_isapi.dll. Here are my sequence of steps: 1) Create the HttpModule 2) Compile and drop dll in the webApp bin directory.
9
2854
by: rn5a | last post by:
Is putting a VB class file in the special directory named App_Code the same as relocating the VB class file from the App_Code directory to another directory & then using the VBC tool, compiling the VB class file into a DLL & putting the DLL in the bin directory? Though while running an ASP.NET app using either of the 2 approaches doesn't make any difference, Visual Web Developer 2005 Express Edition behaves erratically sometimes if the...
1
1529
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I am writing an httpModule for unhandled exceptions. I want to log what application the error occured in. Normally in 1.x I would do this by getting the AssemblyName associated with the executing assembly. In 2.0 this comes up as app_web_x213 which is not real helpful. This is probably the dll that asp.net 2.0 compiled the page to. What's the best way to figure out the name of the app that had the exception?
2
3179
by: Jimi Schacht | last post by:
ok, so, i've got a web project in c#. I'm using IIS instead of dev server. The application builds fine until I add an httpmodule I intend to use for URL rewriting and it's entry in the web.config. the httpmodule is basically a simple implementation as all I've done so far is to implement required methods and to those I've added no code. the app builds but when I go to run it, it says the module type urlrewriter is ambiguous. it says it...
3
1837
by: Joseph Geretz | last post by:
I'm implementing a web application whose purpose in life is to act as a data conduit. Data is posted to my Web app in XML format, my application examines the data and forwards it onward by posting it to the appropriate upstream server. Since transaction processing is largely identical regardless of the transaction details (these will be handled by an upstream sever) I'm thinking of implementing my application as an HttpModule. But I'm...
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.