473,405 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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="SimpleModules.BeginEnd, SimpleModules"
name="BeginEnd"/>
</httpModules>
</system.web>
</configuration>
=====================

using System;
using System.Web;

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

public void Init(System.Web.HttpApplication application)
{
// Wire up beginrequest
application.BeginRequest += new System.EventHandler(BeginRequest);
// Wire up endrequest
application.EndRequest += new System.EventHandler(EndRequest);
// Save the application
mApplication = application;
}

public void BeginRequest(object sender, EventArgs e)
{
mApplication.Response.Write("<!-- Begin Request Time: " +
DateTime.Now.ToString("HH:mm:ss.fffffff") + " -->");
}

public void EndRequest(object sender, EventArgs e)
{
mApplication.Response.Write("<!-- End Request Time: " +
DateTime.Now.ToString("HH:mm:ss.fffffff") + " -->");
}

public void Dispose()
{
}

}
}
=============================
Jul 21 '05 #1
2 1370
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
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...
2
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...
2
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...
4
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...
2
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...
3
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...
13
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...
1
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....
173
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...
3
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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,...
0
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...

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.