473,803 Members | 3,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP Modules

Hi, I'm just trying to learn ASP.NET C# programming from a book.
I'm stuck on the chapter on HTTP modules.

The example in the book shows a fragment to insert into web.config,
plus a program that should be placed in the /bin directory. The book
says this will insert a timestamp into the web page. Actually, all it does
is show an error message in the page

Parser Error Message: File or assembly name SimpleModules,
or one of its dependencies, was not found.

Although the book doesn't say so, I've tried compiling the
given program, as a library, and as a module, I've put both
the source code and the compiled code in the /bin directory,
but I'm still getting the error messages.

I don't understand this. Any idea whats wrong?

Here's the code from the book:

=============== ======
</configuration>
</system.web>
<httpModules>
<add type="SimpleMod ules.BeginEnd, SimpleModules"
name="BeginEnd"/>
</httpModules>
</system.web>
</configuration>
=============== ======

using System;
using System.Web;

namespace SimpleModules
{
/// <summary>
/// Summary description for BeginEnd.
/// <add type="SimpleMod ules.BeginEnd, SimpleModules" name="BeginEnd" />
/// </summary>
public class BeginEnd : IHttpModule
{
private HttpApplication mApplication;

public void Init(System.Web .HttpApplicatio n application)
{
// Wire up beginrequest
application.Beg inRequest += new System.EventHan dler(BeginReque st);
// Wire up endrequest
application.End Request += new System.EventHan dler(EndRequest );
// Save the application
mApplication = application;
}

public void BeginRequest(ob ject sender, EventArgs e)
{
mApplication.Re sponse.Write("< !-- Begin Request Time: " +
DateTime.Now.To String("HH:mm:s s.fffffff") + " -->");
}

public void EndRequest(obje ct sender, EventArgs e)
{
mApplication.Re sponse.Write("< !-- End Request Time: " +
DateTime.Now.To String("HH:mm:s s.fffffff") + " -->");
}

public void Dispose()
{
}

}
}
=============== ==============
Jul 21 '05 #1
2 1418
H

Make sure the web site is an WebApplication.

Ravikanth[MVP
Jul 21 '05 #2
H

Make sure the web site is an WebApplication.

Ravikanth[MVP
Jul 21 '05 #3

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

Similar topics

2
3115
by: Pierre Quentel | last post by:
Python standard library provides two modules for asynchronous socket programming : asyncore and asynchat. Several web servers have been built upon these modules (medusa being the best-known I suppose) and are famous for their performance level Unfortunately no example of use is provided in the standard library (whereas the more "classic" SocketServer is illustrated by BaseHTTPServer, SimpleHTTPServer, etc). I think it would be useful if...
2
3834
by: Dave | last post by:
Hi Everyone, I am trying to import a package and then loop through the modules inside the package, but I'm running to a problem. Basically: ----- I have a package called regression.changepassword.unittests which contains test modules. --- In a test agent module (called agent.a), I do the following:
2
1971
by: Robin Becker | last post by:
We had some legacy applications that used import to get parts of documents in. When run separately these worked fine, but failed when run as a single process because they both imported ch1 (after jumping to their home dirs and placing these on the path). Clearly the first to run used up ch1. I have a simple test script below. It seems I cannot just restore the original sys.modules and leave the modules to die, but actually need to del the...
4
1758
by: Misto . | last post by:
Hi folks! Short: There is a way to dumplicate a module ? I tried copy.deepcopy(module) but hangs with an error (also with standard modules ).. The only solution that I have by now is creating two files and importing them.
2
2039
by: James Buchanan | last post by:
Hi group, I'm preparing Python 2.4.2 for the upcoming Minix 3.x release, and I have problems with make. configure runs fine and creates the makefile, but right at the end ends with an error about a circular dependency in Modules/signalmodule.o. I'm new to makefiles and makefile rules, so I can understand what this means, but I don't know how I can fix this problem. Looks like I'll need to rewrite one or more makefile rules and...
3
1738
by: PCC | last post by:
I need to be able to redirect web requests from certain parties to specific content. In the old days I would have used ISAPI to do this. Now days I am wondering if I should be doing this using HTTP Modules & Handlers or ISAPI. All the machines are running IIS6 and have the .NET framework installed. In the end I would like to code in C# but am concerned about the performance cost of using HTTP Modules & Handlers over that of just using...
13
2372
by: Robin Haswell | last post by:
Hey people I'm an experience PHP programmer who's been writing python for a couple of weeks now. I'm writing quite a large application which I've decided to break down in to lots of modules (replacement for PHP's include() statement). My problem is, in PHP if you open a database connection it's always in scope for the duration of the script. Even if you use an abstraction layer ($db = DB::connect(...)) you can `global $db` and bring...
1
4291
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed. that is certainly not true. I downloaded the http extension from pecl. cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/http
173
5740
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are modules left-over from VB6, and not much used anymore? It seems that it is better to require Imports or use fully qualified names for functions in other classes/modules, but a Module doesn't require this, cluttering the global namespace. It seems...
3
1831
by: Mohamed Yousef | last post by:
Hello , The problem I'm asking about is how can imported modules be aware of other imported modules so they don't have to re-import them (avoiding importing problems and Consicing code and imports ) Take Example :- in A.py :- import B print dir() # no problems we can see B which contain re module and C module
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
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
10316
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
10295
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
9125
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...
0
6842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
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.