S
silesius
Hi all,
I'm using Visual Studio to create an HttpModule. I created a class library
project added my code and two directives System and System.Web, but every
time I try to compile it gives me this error message "The type or namespace
name 'IHttpModule' could not be found (are you missing a using directive or
an assembly reference?)". What am I missing?
TIA for your help
Sample code:
using System;
using System.Web;
namespace myModules {
public class AuthModule: IHttpModule {
public void Init( HttpApplication myApp ) {
}
public void Dispose() {
}
public void OnEnter( object s, EventArgs e ) {
HttpApplication objApp;
HttpContext objContext;
string strPath;
objApp = (HttpApplication)s;
objContext = objApp.Context;
strPath = objContext.Request.Path.ToLower();
if ( strPath.Substring(strPath.Length-10,10) != "login.aspx" ) {
if ( objContext.Request.Params["username"] == null ) {
objContext.Response.Redirect("login.aspx");
}
}
}
public void OnLeave( object s, EventArgs e) {
}
}
}
I'm using Visual Studio to create an HttpModule. I created a class library
project added my code and two directives System and System.Web, but every
time I try to compile it gives me this error message "The type or namespace
name 'IHttpModule' could not be found (are you missing a using directive or
an assembly reference?)". What am I missing?
TIA for your help
Sample code:
using System;
using System.Web;
namespace myModules {
public class AuthModule: IHttpModule {
public void Init( HttpApplication myApp ) {
}
public void Dispose() {
}
public void OnEnter( object s, EventArgs e ) {
HttpApplication objApp;
HttpContext objContext;
string strPath;
objApp = (HttpApplication)s;
objContext = objApp.Context;
strPath = objContext.Request.Path.ToLower();
if ( strPath.Substring(strPath.Length-10,10) != "login.aspx" ) {
if ( objContext.Request.Params["username"] == null ) {
objContext.Response.Redirect("login.aspx");
}
}
}
public void OnLeave( object s, EventArgs e) {
}
}
}