Hi,
Google gives alot of hits on httpmodules but I can't seem to find any
useful on my problem ...
I have a site where I'm using my own auth system ... ( guess it could be
better but its work, maybe I will make a new one later, or use the build
-in )
But to my problem ... I have a Admin area, but that users dont have
access to ... So I wanted to make a httpmodule that checked a Session
variable to see if the user had a high enough level to get access to the
admin area ... but I can't get it working:
I have tried many thing in the Web.Config file ...
<?xml version="1.0"?>
<configuratio n>
<appSettings/>
<connectionStri ngs/>
<system.web>
<httpModules>
<add type="Syska.Err ors.Admin" name="Admin" />
</httpModules>
</system.web>
</configuration>
This file is placed in the "/admin" folder on the site ...
So all the normal request dont get parsed in this module ...
My Class:
using System;
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
namespace Syska.Errors
{
public class Admin : IHttpModule
{
public void Init(HttpApplic ation app)
{
app.BeginReques t += new EventHandler(ap p_BeginRequest) ;
app.Error += new EventHandler(ap p_Error);
}
void app_Error(objec t sender, EventArgs e)
{
throw new Exception("The method or operation is not
implemented.");
}
void app_BeginReques t(object sender, EventArgs e)
{
throw new Exception("The method or operation is not
implemented.");
}
public void Dispose() { }
}
}
And none of the above get executed ...
Am I doing somewrong here ?
best regards
Mikael Syska