Please see below code
public class URLRewriter : IHttpModule {
public void Dispose() {
}
public void Init( HttpApplication context ) {
context.BeginRequest += new EventHandler( context_BeginRequest );
}
void context_BeginRequest( object sender, EventArgs e ) {
//code to make custom
URLhttpApplication.Context.Server.Transfer( CustomPath );
}
}
Here i am using IHttpModule
for making custom URL redirection. But it showing error while setting session in destination page.
ERROR LINE Code :
HttpContext.Current.Session[USERADMIN] == null
ERROR Message:
System.NullReferenceException: Object reference not set to an instance of an object.