473,387 Members | 1,578 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,387 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()
{
}

}
}
=============================
Nov 16 '05 #1
0 1095

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.