473,387 Members | 1,899 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 18 '05 #1
0 683

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

Similar topics

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...
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...
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....
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
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...

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.